1 # /* **************************************************************************
\r
3 # * (C) Copyright Paul Mensonides 2002.
\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_TRAILING_HPP
\r
13 # define BOOST_PREPROCESSOR_REPETITION_ENUM_TRAILING_HPP
\r
15 # include <boost/preprocessor/cat.hpp>
\r
16 # include <boost/preprocessor/config/config.hpp>
\r
17 # include <boost/preprocessor/debug/error.hpp>
\r
18 # include <boost/preprocessor/detail/auto_rec.hpp>
\r
19 # include <boost/preprocessor/repetition/repeat.hpp>
\r
20 # include <boost/preprocessor/tuple/elem.hpp>
\r
21 # include <boost/preprocessor/tuple/rem.hpp>
\r
23 # /* BOOST_PP_ENUM_TRAILING */
\r
26 # define BOOST_PP_ENUM_TRAILING(count, macro, data)
\r
29 # define BOOST_PP_ENUM_TRAILING BOOST_PP_CAT(BOOST_PP_ENUM_TRAILING_, BOOST_PP_AUTO_REC(BOOST_PP_REPEAT_P, 4))
\r
31 # if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
\r
32 # define BOOST_PP_ENUM_TRAILING_1(c, m, d) BOOST_PP_REPEAT_1(c, BOOST_PP_ENUM_TRAILING_M_1, (m, d))
\r
33 # define BOOST_PP_ENUM_TRAILING_2(c, m, d) BOOST_PP_REPEAT_2(c, BOOST_PP_ENUM_TRAILING_M_2, (m, d))
\r
34 # define BOOST_PP_ENUM_TRAILING_3(c, m, d) BOOST_PP_REPEAT_3(c, BOOST_PP_ENUM_TRAILING_M_3, (m, d))
\r
36 # define BOOST_PP_ENUM_TRAILING_1(c, m, d) BOOST_PP_ENUM_TRAILING_1_I(c, m, d)
\r
37 # define BOOST_PP_ENUM_TRAILING_2(c, m, d) BOOST_PP_ENUM_TRAILING_2_I(c, m, d)
\r
38 # define BOOST_PP_ENUM_TRAILING_3(c, m, d) BOOST_PP_ENUM_TRAILING_3_I(c, m, d)
\r
39 # define BOOST_PP_ENUM_TRAILING_1_I(c, m, d) BOOST_PP_REPEAT_1(c, BOOST_PP_ENUM_TRAILING_M_1, (m, d))
\r
40 # define BOOST_PP_ENUM_TRAILING_2_I(c, m, d) BOOST_PP_REPEAT_2(c, BOOST_PP_ENUM_TRAILING_M_2, (m, d))
\r
41 # define BOOST_PP_ENUM_TRAILING_3_I(c, m, d) BOOST_PP_REPEAT_3(c, BOOST_PP_ENUM_TRAILING_M_3, (m, d))
\r
44 # define BOOST_PP_ENUM_TRAILING_4(c, m, d) BOOST_PP_ERROR(0x0003)
\r
46 # if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_STRICT()
\r
47 # define BOOST_PP_ENUM_TRAILING_M_1(z, n, md) BOOST_PP_ENUM_TRAILING_M_1_IM(z, n, BOOST_PP_TUPLE_REM_2 md)
\r
48 # define BOOST_PP_ENUM_TRAILING_M_2(z, n, md) BOOST_PP_ENUM_TRAILING_M_2_IM(z, n, BOOST_PP_TUPLE_REM_2 md)
\r
49 # define BOOST_PP_ENUM_TRAILING_M_3(z, n, md) BOOST_PP_ENUM_TRAILING_M_3_IM(z, n, BOOST_PP_TUPLE_REM_2 md)
\r
50 # define BOOST_PP_ENUM_TRAILING_M_1_IM(z, n, im) BOOST_PP_ENUM_TRAILING_M_1_I(z, n, im)
\r
51 # define BOOST_PP_ENUM_TRAILING_M_2_IM(z, n, im) BOOST_PP_ENUM_TRAILING_M_2_I(z, n, im)
\r
52 # define BOOST_PP_ENUM_TRAILING_M_3_IM(z, n, im) BOOST_PP_ENUM_TRAILING_M_3_I(z, n, im)
\r
54 # define BOOST_PP_ENUM_TRAILING_M_1(z, n, md) BOOST_PP_ENUM_TRAILING_M_1_I(z, n, BOOST_PP_TUPLE_ELEM(2, 0, md), BOOST_PP_TUPLE_ELEM(2, 1, md))
\r
55 # define BOOST_PP_ENUM_TRAILING_M_2(z, n, md) BOOST_PP_ENUM_TRAILING_M_2_I(z, n, BOOST_PP_TUPLE_ELEM(2, 0, md), BOOST_PP_TUPLE_ELEM(2, 1, md))
\r
56 # define BOOST_PP_ENUM_TRAILING_M_3(z, n, md) BOOST_PP_ENUM_TRAILING_M_3_I(z, n, BOOST_PP_TUPLE_ELEM(2, 0, md), BOOST_PP_TUPLE_ELEM(2, 1, md))
\r
59 # define BOOST_PP_ENUM_TRAILING_M_1_I(z, n, m, d) , m(z, n, d)
\r
60 # define BOOST_PP_ENUM_TRAILING_M_2_I(z, n, m, d) , m(z, n, d)
\r
61 # define BOOST_PP_ENUM_TRAILING_M_3_I(z, n, m, d) , m(z, n, d)
\r