test_is_empty.cpp 870 B

1234567891011121314151617181920212223242526272829303132333435
  1. // Boost.TypeErasure library
  2. //
  3. // Copyright 2011 Steven Watanabe
  4. //
  5. // Distributed under the Boost Software License Version 1.0. (See
  6. // accompanying file LICENSE_1_0.txt or copy at
  7. // http://www.boost.org/LICENSE_1_0.txt)
  8. //
  9. // $Id$
  10. #include <boost/type_erasure/any.hpp>
  11. #include <boost/type_erasure/is_empty.hpp>
  12. #include <boost/type_erasure/builtin.hpp>
  13. #include <boost/mpl/vector.hpp>
  14. #define BOOST_TEST_MAIN
  15. #include <boost/test/unit_test.hpp>
  16. using namespace boost::type_erasure;
  17. BOOST_AUTO_TEST_CASE(test_non_relaxed)
  18. {
  19. typedef copy_constructible<> test_concept;
  20. any<test_concept> x(2);
  21. BOOST_CHECK(!is_empty(x));
  22. }
  23. BOOST_AUTO_TEST_CASE(test_relaxed)
  24. {
  25. typedef boost::mpl::vector<copy_constructible<>, relaxed> test_concept;
  26. any<test_concept> x(2);
  27. BOOST_CHECK(!is_empty(x));
  28. any<test_concept> y;
  29. BOOST_CHECK(is_empty(y));
  30. }