• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 
2 //  (C) Copyright Edward Diener 2011-2015
3 //  Use, modification and distribution are subject to the Boost Software License,
4 //  Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
5 //  http://www.boost.org/LICENSE_1_0.txt).
6 
7 #include <boost/vmd/equal.hpp>
8 #include <boost/vmd/get_type.hpp>
9 #include <boost/vmd/is_empty.hpp>
10 #include <boost/vmd/is_multi.hpp>
11 #include <boost/vmd/is_unary.hpp>
12 #include <boost/vmd/size.hpp>
13 #include <boost/detail/lightweight_test.hpp>
14 
main()15 int main()
16   {
17 
18 #if BOOST_PP_VARIADICS
19 
20  #define AN_EMPTY_SEQUENCE
21 
22  BOOST_TEST(BOOST_VMD_IS_EMPTY(AN_EMPTY_SEQUENCE));
23  BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_TYPE_EMPTY,BOOST_VMD_GET_TYPE(AN_EMPTY_SEQUENCE)));
24 
25  #define A_SINGLE_ELEMENT_SEQUENCE (1,2)
26 
27  BOOST_TEST(BOOST_VMD_IS_UNARY(A_SINGLE_ELEMENT_SEQUENCE));
28  BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_TYPE_TUPLE,BOOST_VMD_GET_TYPE(A_SINGLE_ELEMENT_SEQUENCE)));
29 
30  #define A_MULTI_ELEMENT_SEQUENCE (1,2) (1)(2) 45
31 
32  BOOST_TEST(BOOST_VMD_IS_MULTI(A_MULTI_ELEMENT_SEQUENCE));
33  BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_TYPE_SEQUENCE,BOOST_VMD_GET_TYPE(A_MULTI_ELEMENT_SEQUENCE)));
34 
35  BOOST_TEST_EQ(BOOST_VMD_SIZE(AN_EMPTY_SEQUENCE),0);
36  BOOST_TEST_EQ(BOOST_VMD_SIZE(A_SINGLE_ELEMENT_SEQUENCE),1);
37  BOOST_TEST_EQ(BOOST_VMD_SIZE(A_MULTI_ELEMENT_SEQUENCE),3);
38 
39 #else
40 
41 BOOST_ERROR("No variadic macro support");
42 
43 #endif
44 
45   return boost::report_errors();
46 
47   }
48