1 #ifndef BOOST_PREPROCESSOR_ENUM_SHIFTED_HPP
2 #define BOOST_PREPROCESSOR_ENUM_SHIFTED_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/enum.hpp>
17 #include <boost/preprocessor/dec.hpp>
18 #include <boost/preprocessor/inc.hpp>
20 /** <p>Generates a comma separated shifted list.</p>
22 <p>In other words, expands to the sequence:</p>
25 MACRO(1,DATA), MACRO(2,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_SHIFTED(3,TYPED_PARAM,(X,x))
44 <li>BOOST_PP_REPEAT()</li>
47 #define BOOST_PP_ENUM_SHIFTED(COUNT,MACRO,DATA) BOOST_PP_ENUM(BOOST_PP_DEC(COUNT),BOOST_PP_ENUM_SHIFTED_F,(MACRO,DATA))
49 #define BOOST_PP_ENUM_SHIFTED_F(I,MD) BOOST_PP_TUPLE_ELEM(2,0,MD)(BOOST_PP_INC(I),BOOST_PP_TUPLE_ELEM(2,1,MD))