test_seq_push_front.cxx 919 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/seq/push_front.hpp>
  6. #include <boost/preprocessor/seq/elem.hpp>
  7. #include <boost/preprocessor/seq/size.hpp>
  8. #include <boost/detail/lightweight_test.hpp>
  9. int main()
  10. {
  11. #if BOOST_PP_VARIADICS
  12. #define A_SEQ (1)(2)(3)(4)
  13. #define AN_EMPTY_SEQ
  14. BOOST_TEST_EQ(BOOST_PP_SEQ_ELEM(0,BOOST_VMD_SEQ_PUSH_FRONT(A_SEQ,10)),10);
  15. BOOST_TEST_EQ(BOOST_PP_SEQ_SIZE(BOOST_VMD_SEQ_PUSH_FRONT(A_SEQ,10)),5);
  16. BOOST_TEST_EQ(BOOST_PP_SEQ_ELEM(0,BOOST_VMD_SEQ_PUSH_FRONT(AN_EMPTY_SEQ,20)),20);
  17. BOOST_TEST_EQ(BOOST_PP_SEQ_SIZE(BOOST_VMD_SEQ_PUSH_FRONT(AN_EMPTY_SEQ,20)),1);
  18. #else
  19. BOOST_ERROR("No variadic macro support");
  20. #endif
  21. return boost::report_errors();
  22. }