test_is_list.cxx 853 B

123456789101112131415161718192021222324252627282930313233
  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/is_list.hpp>
  6. #include <boost/detail/lightweight_test.hpp>
  7. int main()
  8. {
  9. #if BOOST_PP_VARIADICS
  10. #define A_LIST (e,(g,(&,BOOST_PP_NIL)))
  11. #define AN_EMPTY_LIST BOOST_PP_NIL
  12. #define AN_EMPTY_LIST_PLUS BOOST_PP_NIL ( here )
  13. BOOST_TEST(BOOST_VMD_IS_LIST((4,(x,BOOST_PP_NIL))));
  14. BOOST_TEST(BOOST_VMD_IS_LIST(((3,6m,irj),(x,BOOST_PP_NIL))));
  15. BOOST_TEST(BOOST_VMD_IS_LIST(A_LIST));
  16. BOOST_TEST(BOOST_VMD_IS_LIST(AN_EMPTY_LIST));
  17. BOOST_TEST(!BOOST_VMD_IS_LIST(AN_EMPTY_LIST_PLUS));
  18. #else
  19. BOOST_ERROR("No variadic macro support");
  20. #endif
  21. return boost::report_errors();
  22. }