test_list_to_tuple.cxx 775 B

12345678910111213141516171819202122232425262728293031
  1. // (C) Copyright Edward Diener 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/list/to_tuple.hpp>
  6. #include <boost/vmd/is_empty.hpp>
  7. #include <boost/detail/lightweight_test.hpp>
  8. #include <boost/preprocessor/tuple/elem.hpp>
  9. int main()
  10. {
  11. #if BOOST_PP_VARIADICS
  12. #define A_LIST (1,(2,(3,(4,BOOST_PP_NIL))))
  13. #define AN_EMPTY_LIST BOOST_PP_NIL
  14. BOOST_TEST_EQ(BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_LIST_TO_TUPLE(A_LIST)),1);
  15. BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_LIST_TO_TUPLE(AN_EMPTY_LIST)));
  16. #else
  17. BOOST_ERROR("No variadic macro support");
  18. #endif
  19. return boost::report_errors();
  20. }