1 # /* **************************************************************************
\r
3 # * (C) Copyright Paul Mensonides 2005. *
\r
4 # * Distributed under the Boost Software License, Version 1.0. (See *
\r
5 # * accompanying file LICENSE_1_0.txt or copy at *
\r
6 # * http://www.boost.org/LICENSE_1_0.txt) *
\r
8 # ************************************************************************** */
\r
10 # /* See http://www.boost.org for most recent version. */
\r
12 # ifndef BOOST_PREPROCESSOR_REPETITION_ENUM_SHIFTED_BINARY_PARAMS_HPP
\r
13 # define BOOST_PREPROCESSOR_REPETITION_ENUM_SHIFTED_BINARY_PARAMS_HPP
\r
15 # include <boost/preprocessor/arithmetic/dec.hpp>
\r
16 # include <boost/preprocessor/arithmetic/inc.hpp>
\r
17 # include <boost/preprocessor/cat.hpp>
\r
18 # include <boost/preprocessor/config/config.hpp>
\r
19 # include <boost/preprocessor/punctuation/comma_if.hpp>
\r
20 # include <boost/preprocessor/repetition/repeat.hpp>
\r
21 # include <boost/preprocessor/tuple/elem.hpp>
\r
22 # include <boost/preprocessor/tuple/rem.hpp>
\r
24 # /* BOOST_PP_ENUM_SHIFTED_BINARY_PARAMS */
\r
26 # if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
\r
27 # define BOOST_PP_ENUM_SHIFTED_BINARY_PARAMS(count, p1, p2) BOOST_PP_REPEAT(BOOST_PP_DEC(count), BOOST_PP_ENUM_SHIFTED_BINARY_PARAMS_M, (p1, p2))
\r
29 # define BOOST_PP_ENUM_SHIFTED_BINARY_PARAMS(count, p1, p2) BOOST_PP_ENUM_SHIFTED_BINARY_PARAMS_I(count, p1, p2)
\r
30 # define BOOST_PP_ENUM_SHIFTED_BINARY_PARAMS_I(count, p1, p2) BOOST_PP_REPEAT(BOOST_PP_DEC(count), BOOST_PP_ENUM_SHIFTED_BINARY_PARAMS_M, (p1, p2))
\r
33 # if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_STRICT()
\r
34 # define BOOST_PP_ENUM_SHIFTED_BINARY_PARAMS_M(z, n, pp) BOOST_PP_ENUM_SHIFTED_BINARY_PARAMS_M_IM(z, n, BOOST_PP_TUPLE_REM_2 pp)
\r
35 # define BOOST_PP_ENUM_SHIFTED_BINARY_PARAMS_M_IM(z, n, im) BOOST_PP_ENUM_SHIFTED_BINARY_PARAMS_M_I(z, n, im)
\r
37 # define BOOST_PP_ENUM_SHIFTED_BINARY_PARAMS_M(z, n, pp) BOOST_PP_ENUM_SHIFTED_BINARY_PARAMS_M_I(z, n, BOOST_PP_TUPLE_ELEM(2, 0, pp), BOOST_PP_TUPLE_ELEM(2, 1, pp))
\r
40 # define BOOST_PP_ENUM_SHIFTED_BINARY_PARAMS_M_I(z, n, p1, p2) BOOST_PP_COMMA_IF(n) BOOST_PP_CAT(p1, BOOST_PP_INC(n)) BOOST_PP_CAT(p2, BOOST_PP_INC(n))
\r
42 # /* BOOST_PP_ENUM_SHIFTED_BINARY_PARAMS_Z */
\r
44 # if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
\r
45 # define BOOST_PP_ENUM_SHIFTED_BINARY_PARAMS_Z(z, count, p1, p2) BOOST_PP_REPEAT_ ## z(BOOST_PP_DEC(count), BOOST_PP_ENUM_SHIFTED_BINARY_PARAMS_M, (p1, p2))
\r
47 # define BOOST_PP_ENUM_SHIFTED_BINARY_PARAMS_Z(z, count, p1, p2) BOOST_PP_ENUM_SHIFTED_BINARY_PARAMS_Z_I(z, count, p1, p2)
\r
48 # define BOOST_PP_ENUM_SHIFTED_BINARY_PARAMS_Z_I(z, count, p1, p2) BOOST_PP_REPEAT_ ## z(BOOST_PP_DEC(count), BOOST_PP_ENUM_SHIFTED_BINARY_PARAMS_M, (p1, p2))
\r