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