test_assert_is_type.cxx 991 B

123456789101112131415161718192021222324252627282930313233343536
  1. // (C) Copyright Edward Diener 2011-2015
  2. // Use, modification and distribution are subject to the Boost Software License,
  3. // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  4. // http://www.boost.org/LICENSE_1_0.txt).
  5. #include <boost/vmd/assert_is_type.hpp>
  6. #include <boost/detail/lightweight_test.hpp>
  7. #include <boost/preprocessor/list/at.hpp>
  8. #include <boost/preprocessor/seq/elem.hpp>
  9. #include <boost/preprocessor/tuple/elem.hpp>
  10. int main()
  11. {
  12. #if BOOST_PP_VARIADICS
  13. #define A_TUPLE (4,BOOST_VMD_TYPE_ARRAY,zzz)
  14. #define KDATA BOOST_VMD_TYPE_TYPE
  15. #define A_SEQ (num)(78)(BOOST_VMD_TYPE_UNKNOWN)
  16. #define A_LIST (eeb,(grist,(BOOST_VMD_TYPE_EMPTY,BOOST_PP_NIL)))
  17. BOOST_VMD_ASSERT_IS_TYPE(BOOST_PP_TUPLE_ELEM(1,A_TUPLE))
  18. BOOST_VMD_ASSERT_IS_TYPE(KDATA)
  19. BOOST_VMD_ASSERT_IS_TYPE(BOOST_PP_SEQ_ELEM(2,A_SEQ))
  20. BOOST_VMD_ASSERT_IS_TYPE(BOOST_PP_LIST_AT(A_LIST,2))
  21. #else
  22. BOOST_VMD_ASSERT(0)
  23. #endif
  24. return boost::report_errors();
  25. }