test_is_placeholder.cpp 954 B

123456789101112131415161718192021222324252627282930313233
  1. // Boost.TypeErasure library
  2. //
  3. // Copyright 2012 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/is_placeholder.hpp>
  11. #include <boost/type_erasure/placeholder.hpp>
  12. #include <boost/mpl/assert.hpp>
  13. using namespace boost::type_erasure;
  14. struct a_placeholder : placeholder {};
  15. struct not_placeholder {};
  16. struct incomplete;
  17. template<class T>
  18. struct t_placeholder : placeholder {};
  19. template<class T>
  20. struct t_incomplete;
  21. BOOST_MPL_ASSERT((is_placeholder<a_placeholder>));
  22. BOOST_MPL_ASSERT_NOT((is_placeholder<not_placeholder>));
  23. BOOST_MPL_ASSERT_NOT((is_placeholder<incomplete>));
  24. BOOST_MPL_ASSERT_NOT((is_placeholder<int>));
  25. BOOST_MPL_ASSERT_NOT((is_placeholder<void>));
  26. BOOST_MPL_ASSERT((is_placeholder<t_placeholder<int> >));
  27. BOOST_MPL_ASSERT_NOT((is_placeholder<t_incomplete<int> >));