is_placeholder.cpp 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // Copyright Aleksey Gurtovoy 2000-2004
  2. //
  3. // Distributed under the Boost Software License, Version 1.0.
  4. // (See accompanying file LICENSE_1_0.txt or copy at
  5. // http://www.boost.org/LICENSE_1_0.txt)
  6. //
  7. // See http://www.boost.org/libs/mpl for documentation.
  8. // $Id$
  9. // $Date$
  10. // $Revision$
  11. #include <boost/mpl/is_placeholder.hpp>
  12. #include <boost/mpl/placeholders.hpp>
  13. #include <boost/mpl/aux_/test.hpp>
  14. #include <boost/preprocessor/repeat.hpp>
  15. #include <boost/preprocessor/inc.hpp>
  16. #include <boost/preprocessor/cat.hpp>
  17. #define AUX_IS_PLACEHOLDER_TEST(unused1, n, unused2) \
  18. { MPL_ASSERT(( is_placeholder< \
  19. BOOST_PP_CAT(_,BOOST_PP_INC(n)) \
  20. > )); } \
  21. /**/
  22. MPL_TEST_CASE()
  23. {
  24. MPL_ASSERT_NOT(( is_placeholder<int> ));
  25. MPL_ASSERT_NOT(( is_placeholder<UDT> ));
  26. MPL_ASSERT_NOT(( is_placeholder<incomplete> ));
  27. MPL_ASSERT_NOT(( is_placeholder<abstract> ));
  28. MPL_ASSERT_NOT(( is_placeholder<noncopyable> ));
  29. MPL_ASSERT(( is_placeholder<_> ));
  30. BOOST_PP_REPEAT(
  31. BOOST_MPL_LIMIT_METAFUNCTION_ARITY
  32. , AUX_IS_PLACEHOLDER_TEST
  33. , unused
  34. )
  35. }