1 #ifndef BOOST_PREPROCESSOR_ENUM_PARAMS_WITH_A_DEFAULT_HPP
2 #define BOOST_PREPROCESSOR_ENUM_PARAMS_WITH_A_DEFAULT_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/cat.hpp>
17 #include <boost/preprocessor/enum.hpp>
19 /** <p>Generates a comma separated list of parameters with a default.</p>
21 <p>In other words, expands to the sequence:</p>
24 BOOST_PP_CAT(PARAM,0) = DEFAULT,
25 BOOST_PP_CAT(PARAM,1) = DEFAULT,
27 BOOST_PP_CAT(PARAM,BOOST_PP_DEC(COUNT)) = DEFAULT
33 BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(3,x,y)
39 x0 = y, x1 = y, x2 = y
44 <li>BOOST_PP_REPEAT()</li>
49 <li><a href="../../test/repeat_test.cpp">repeat_test.cpp</a></li>
52 #define BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(COUNT,PARAM,DEFAULT) BOOST_PP_ENUM(COUNT,BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT_F,(PARAM,DEFAULT))
54 #define BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT_F(I,PD) BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2,0,PD),I)=BOOST_PP_TUPLE_ELEM(2,1,PD)