1 #ifndef BOOST_PREPROCESSOR_ENUM_HPP
2 #define BOOST_PREPROCESSOR_ENUM_HPP
6 * http://www.housemarque.com
8 * Permission to copy, use, modify, sell and distribute this software is
9 * granted provided this copyright notice appears in all copies. This
10 * software is provided "as is" without express or implied warranty, and
11 * with no claim as to its suitability for any purpose.
13 * See http://www.boost.org for most recent version.
16 #include <boost/preprocessor/comma_if.hpp>
17 #include <boost/preprocessor/repeat.hpp>
18 #include <boost/preprocessor/tuple.hpp>
20 /** <p>Generates a comma separated list.</p>
22 <p>In other words, expands to the sequence:</p>
25 MACRO(0,DATA), MACRO(1,DATA), ..., MACRO(BOOST_PP_DEC(COUNT),DATA)
31 #define TYPED_PARAM(INDEX,DATA)\
32 BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2,0,DATA),INDEX) BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2,1,DATA),INDEX)
33 BOOST_PP_ENUM(3,TYPED_PARAM,(X,x))
44 <li>BOOST_PP_REPEAT()</li>
49 <li><a href="../../test/repeat_test.cpp">repeat_test.cpp</a></li>
52 #define BOOST_PP_ENUM(COUNT,MACRO,DATA) BOOST_PP_REPEAT(COUNT,BOOST_PP_ENUM_F,(MACRO,DATA))
54 #if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__)
55 # define BOOST_PP_ENUM_F(I,FP) BOOST_PP_COMMA_IF(I) BOOST_PP_TUPLE_ELEM(2,0,FP)(I,BOOST_PP_TUPLE_ELEM(2,1,FP))
57 # define BOOST_PP_ENUM_F(I,FP) BOOST_PP_COMMA_IF(I) BOOST_PP_TUPLE2_ELEM0 FP(I,BOOST_PP_TUPLE2_ELEM1 FP)