Chris@16
|
1 # /* **************************************************************************
|
Chris@16
|
2 # * *
|
Chris@16
|
3 # * (C) Copyright Paul Mensonides 2002.
|
Chris@16
|
4 # * Distributed under the Boost Software License, Version 1.0. (See
|
Chris@16
|
5 # * accompanying file LICENSE_1_0.txt or copy at
|
Chris@16
|
6 # * http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
7 # * *
|
Chris@16
|
8 # ************************************************************************** */
|
Chris@16
|
9 #
|
Chris@16
|
10 # /* See http://www.boost.org for most recent version. */
|
Chris@16
|
11 #
|
Chris@16
|
12 # ifndef BOOST_PREPROCESSOR_SEQ_FOR_EACH_HPP
|
Chris@16
|
13 # define BOOST_PREPROCESSOR_SEQ_FOR_EACH_HPP
|
Chris@16
|
14 #
|
Chris@16
|
15 # include <boost/preprocessor/arithmetic/dec.hpp>
|
Chris@16
|
16 # include <boost/preprocessor/config/config.hpp>
|
Chris@16
|
17 # include <boost/preprocessor/repetition/for.hpp>
|
Chris@16
|
18 # include <boost/preprocessor/seq/seq.hpp>
|
Chris@16
|
19 # include <boost/preprocessor/seq/size.hpp>
|
Chris@16
|
20 # include <boost/preprocessor/tuple/elem.hpp>
|
Chris@16
|
21 # include <boost/preprocessor/tuple/rem.hpp>
|
Chris@16
|
22 #
|
Chris@16
|
23 # /* BOOST_PP_SEQ_FOR_EACH */
|
Chris@16
|
24 #
|
Chris@16
|
25 # if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
|
Chris@16
|
26 # define BOOST_PP_SEQ_FOR_EACH(macro, data, seq) BOOST_PP_FOR((macro, data, seq (nil)), BOOST_PP_SEQ_FOR_EACH_P, BOOST_PP_SEQ_FOR_EACH_O, BOOST_PP_SEQ_FOR_EACH_M)
|
Chris@16
|
27 # else
|
Chris@16
|
28 # define BOOST_PP_SEQ_FOR_EACH(macro, data, seq) BOOST_PP_SEQ_FOR_EACH_D(macro, data, seq)
|
Chris@16
|
29 # define BOOST_PP_SEQ_FOR_EACH_D(macro, data, seq) BOOST_PP_FOR((macro, data, seq (nil)), BOOST_PP_SEQ_FOR_EACH_P, BOOST_PP_SEQ_FOR_EACH_O, BOOST_PP_SEQ_FOR_EACH_M)
|
Chris@16
|
30 # endif
|
Chris@16
|
31 #
|
Chris@16
|
32 # define BOOST_PP_SEQ_FOR_EACH_P(r, x) BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(BOOST_PP_TUPLE_ELEM(3, 2, x)))
|
Chris@16
|
33 #
|
Chris@16
|
34 # if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_STRICT()
|
Chris@16
|
35 # define BOOST_PP_SEQ_FOR_EACH_O(r, x) BOOST_PP_SEQ_FOR_EACH_O_I x
|
Chris@16
|
36 # else
|
Chris@16
|
37 # define BOOST_PP_SEQ_FOR_EACH_O(r, x) BOOST_PP_SEQ_FOR_EACH_O_I(BOOST_PP_TUPLE_ELEM(3, 0, x), BOOST_PP_TUPLE_ELEM(3, 1, x), BOOST_PP_TUPLE_ELEM(3, 2, x))
|
Chris@16
|
38 # endif
|
Chris@16
|
39 #
|
Chris@16
|
40 # define BOOST_PP_SEQ_FOR_EACH_O_I(macro, data, seq) (macro, data, BOOST_PP_SEQ_TAIL(seq))
|
Chris@16
|
41 #
|
Chris@16
|
42 # if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_STRICT()
|
Chris@16
|
43 # define BOOST_PP_SEQ_FOR_EACH_M(r, x) BOOST_PP_SEQ_FOR_EACH_M_IM(r, BOOST_PP_TUPLE_REM_3 x)
|
Chris@16
|
44 # define BOOST_PP_SEQ_FOR_EACH_M_IM(r, im) BOOST_PP_SEQ_FOR_EACH_M_I(r, im)
|
Chris@16
|
45 # else
|
Chris@16
|
46 # define BOOST_PP_SEQ_FOR_EACH_M(r, x) BOOST_PP_SEQ_FOR_EACH_M_I(r, BOOST_PP_TUPLE_ELEM(3, 0, x), BOOST_PP_TUPLE_ELEM(3, 1, x), BOOST_PP_TUPLE_ELEM(3, 2, x))
|
Chris@16
|
47 # endif
|
Chris@16
|
48 #
|
Chris@16
|
49 # define BOOST_PP_SEQ_FOR_EACH_M_I(r, macro, data, seq) macro(r, data, BOOST_PP_SEQ_HEAD(seq))
|
Chris@16
|
50 #
|
Chris@16
|
51 # /* BOOST_PP_SEQ_FOR_EACH_R */
|
Chris@16
|
52 #
|
Chris@16
|
53 # if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
|
Chris@16
|
54 # define BOOST_PP_SEQ_FOR_EACH_R(r, macro, data, seq) BOOST_PP_FOR_ ## r((macro, data, seq (nil)), BOOST_PP_SEQ_FOR_EACH_P, BOOST_PP_SEQ_FOR_EACH_O, BOOST_PP_SEQ_FOR_EACH_M)
|
Chris@16
|
55 # else
|
Chris@16
|
56 # define BOOST_PP_SEQ_FOR_EACH_R(r, macro, data, seq) BOOST_PP_SEQ_FOR_EACH_R_I(r, macro, data, seq)
|
Chris@16
|
57 # define BOOST_PP_SEQ_FOR_EACH_R_I(r, macro, data, seq) BOOST_PP_FOR_ ## r((macro, data, seq (nil)), BOOST_PP_SEQ_FOR_EACH_P, BOOST_PP_SEQ_FOR_EACH_O, BOOST_PP_SEQ_FOR_EACH_M)
|
Chris@16
|
58 # endif
|
Chris@16
|
59 #
|
Chris@16
|
60 # endif
|