• 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/size.hpp>
8 #include <boost/detail/lightweight_test.hpp>
9 
main()10 int main()
11   {
12 
13 #if BOOST_PP_VARIADICS
14 
15   #define BOOST_VMD_REGISTER_ggh (ggh)
16   #define BOOST_VMD_DETECT_ggh_ggh
17   #define BOOST_VMD_REGISTER_dvd (dvd)
18   #define BOOST_VMD_DETECT_dvd_dvd
19 
20   #define ANIDENTIFIER ggh
21   #define ANIDENTIFIER2 dvd
22   #define ANUMBER 249
23   #define ANUMBER2 17
24   #define ASEQ (25)(26)(27)
25   #define ATUPLE (0,1,2,3,((a,b))((c,d))((e))((f,g,h)))
26   #define ALIST (0,(1,(2,(3,BOOST_PP_NIL))))
27   #define ANARRAY (3,(a,b,38))
28   #define ASEQUENCE ANUMBER ALIST ATUPLE ANIDENTIFIER ANARRAY ASEQ
29   #define ASEQUENCE2 ANIDENTIFIER2 ASEQ ALIST ANUMBER ATUPLE
30   #define ASEQUENCE3 ASEQ ANUMBER2 ATUPLE
31   #define ASEQUENCE4
32 
33   /* SIZE */
34 
35   BOOST_TEST_EQ(BOOST_VMD_SIZE(ASEQUENCE),6);
36   BOOST_TEST_EQ(BOOST_VMD_SIZE(ASEQUENCE2),5);
37   BOOST_TEST_EQ(BOOST_VMD_SIZE(ASEQUENCE3),3);
38   BOOST_TEST_EQ(BOOST_VMD_SIZE(ASEQUENCE4),0);
39 
40 #else
41 
42 BOOST_ERROR("No variadic macro support");
43 
44 #endif
45 
46   return boost::report_errors();
47 
48   }
49