test_tuple_pop_front.cxx 872 B

123456789101112131415161718192021222324252627282930313233
  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/tuple/pop_front.hpp>
  6. #include <boost/vmd/is_empty.hpp>
  7. #include <boost/preprocessor/tuple/elem.hpp>
  8. #include <boost/preprocessor/tuple/size.hpp>
  9. #include <boost/detail/lightweight_test.hpp>
  10. int main()
  11. {
  12. #if BOOST_PP_VARIADICS
  13. #define A_TUPLE (1,2,3,4)
  14. #define AN_SE_TUPLE (1)
  15. BOOST_TEST_EQ(BOOST_PP_TUPLE_ELEM(2,BOOST_VMD_TUPLE_POP_FRONT(A_TUPLE)),4);
  16. BOOST_TEST_EQ(BOOST_PP_TUPLE_SIZE(BOOST_VMD_TUPLE_POP_FRONT(A_TUPLE)),3);
  17. BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_TUPLE_POP_FRONT(AN_SE_TUPLE)));
  18. #else
  19. BOOST_ERROR("No variadic macro support");
  20. #endif
  21. return boost::report_errors();
  22. }