• 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/is_number.hpp>
8 #include <boost/detail/lightweight_test.hpp>
9 #include <boost/preprocessor/list/at.hpp>
10 #include <boost/preprocessor/seq/elem.hpp>
11 #include <boost/preprocessor/tuple/elem.hpp>
12 
main()13 int main()
14   {
15 
16 #if BOOST_PP_VARIADICS
17 
18 #define A_TUPLE (4,241,zzz)
19 #define JDATA somevalue
20 #define KDATA 213
21 #define A_SEQ (num)(78)(42)
22 #define A_LIST (eeb,(grist,(152,BOOST_PP_NIL)))
23 
24 BOOST_TEST(!BOOST_VMD_IS_NUMBER(BOOST_PP_TUPLE_ELEM(2,A_TUPLE)));
25 BOOST_TEST(BOOST_VMD_IS_NUMBER(BOOST_PP_TUPLE_ELEM(1,A_TUPLE)));
26 BOOST_TEST(!BOOST_VMD_IS_NUMBER(JDATA));
27 BOOST_TEST(BOOST_VMD_IS_NUMBER(KDATA));
28 BOOST_TEST(!BOOST_VMD_IS_NUMBER(BOOST_PP_SEQ_ELEM(0,A_SEQ)));
29 BOOST_TEST(BOOST_VMD_IS_NUMBER(BOOST_PP_SEQ_ELEM(2,A_SEQ)));
30 BOOST_TEST(!BOOST_VMD_IS_NUMBER(BOOST_PP_LIST_AT(A_LIST,0)));
31 BOOST_TEST(BOOST_VMD_IS_NUMBER(BOOST_PP_LIST_AT(A_LIST,2)));
32 BOOST_TEST(!BOOST_VMD_IS_NUMBER(BOOST_PP_LIST_AT(A_LIST,1)));
33 BOOST_TEST(!BOOST_VMD_IS_NUMBER((XXX)));
34 BOOST_TEST(!BOOST_VMD_IS_NUMBER());
35 
36 #else
37 
38 BOOST_ERROR("No variadic macro support");
39 
40 #endif
41 
42   return boost::report_errors();
43 
44   }
45