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_CAT_HPP
|
williamr@2
|
13 |
# define BOOST_PREPROCESSOR_SEQ_CAT_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/control/if.hpp>
|
williamr@2
|
18 |
# include <boost/preprocessor/seq/fold_left.hpp>
|
williamr@2
|
19 |
# include <boost/preprocessor/seq/seq.hpp>
|
williamr@2
|
20 |
# include <boost/preprocessor/seq/size.hpp>
|
williamr@2
|
21 |
# include <boost/preprocessor/tuple/eat.hpp>
|
williamr@2
|
22 |
#
|
williamr@2
|
23 |
# /* BOOST_PP_SEQ_CAT */
|
williamr@2
|
24 |
#
|
williamr@2
|
25 |
# define BOOST_PP_SEQ_CAT(seq) \
|
williamr@2
|
26 |
BOOST_PP_IF( \
|
williamr@2
|
27 |
BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(seq)), \
|
williamr@2
|
28 |
BOOST_PP_SEQ_CAT_I, \
|
williamr@2
|
29 |
BOOST_PP_SEQ_HEAD(seq) BOOST_PP_TUPLE_EAT_1 \
|
williamr@2
|
30 |
)(seq) \
|
williamr@2
|
31 |
/**/
|
williamr@2
|
32 |
# define BOOST_PP_SEQ_CAT_I(seq) BOOST_PP_SEQ_FOLD_LEFT(BOOST_PP_SEQ_CAT_O, BOOST_PP_SEQ_HEAD(seq), BOOST_PP_SEQ_TAIL(seq))
|
williamr@2
|
33 |
#
|
williamr@2
|
34 |
# define BOOST_PP_SEQ_CAT_O(s, st, elem) BOOST_PP_SEQ_CAT_O_I(st, elem)
|
williamr@2
|
35 |
# define BOOST_PP_SEQ_CAT_O_I(a, b) a ## b
|
williamr@2
|
36 |
#
|
williamr@2
|
37 |
# /* BOOST_PP_SEQ_CAT_S */
|
williamr@2
|
38 |
#
|
williamr@2
|
39 |
# define BOOST_PP_SEQ_CAT_S(s, seq) \
|
williamr@2
|
40 |
BOOST_PP_IF( \
|
williamr@2
|
41 |
BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(seq)), \
|
williamr@2
|
42 |
BOOST_PP_SEQ_CAT_S_I, \
|
williamr@2
|
43 |
BOOST_PP_SEQ_HEAD(seq) BOOST_PP_TUPLE_EAT_2 \
|
williamr@2
|
44 |
)(s, seq) \
|
williamr@2
|
45 |
/**/
|
williamr@2
|
46 |
# define BOOST_PP_SEQ_CAT_S_I(s, seq) BOOST_PP_SEQ_FOLD_LEFT_ ## s(BOOST_PP_SEQ_CAT_O, BOOST_PP_SEQ_HEAD(seq), BOOST_PP_SEQ_TAIL(seq))
|
williamr@2
|
47 |
#
|
williamr@2
|
48 |
# endif
|