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