1 # /* ************************************************************************** |
1 # /* Copyright (C) 2001 |
2 # * * |
2 # * Housemarque Oy |
3 # * (C) Copyright Paul Mensonides 2002. |
3 # * http://www.housemarque.com |
4 # * Distributed under the Boost Software License, Version 1.0. (See |
4 # * |
5 # * accompanying file LICENSE_1_0.txt or copy at |
5 # * Distributed under the Boost Software License, Version 1.0. (See |
6 # * http://www.boost.org/LICENSE_1_0.txt) |
6 # * accompanying file LICENSE_1_0.txt or copy at |
7 # * * |
7 # * http://www.boost.org/LICENSE_1_0.txt) |
8 # ************************************************************************** */ |
8 # */ |
|
9 # |
|
10 # /* Revised by Paul Mensonides (2002) */ |
9 # |
11 # |
10 # /* See http://www.boost.org for most recent version. */ |
12 # /* See http://www.boost.org for most recent version. */ |
11 # |
13 # |
12 # ifndef BOOST_PREPROCESSOR_SEQ_CAT_HPP |
14 # ifndef BOOST_PREPROCESSOR_CAT_HPP |
13 # define BOOST_PREPROCESSOR_SEQ_CAT_HPP |
15 # define BOOST_PREPROCESSOR_CAT_HPP |
14 # |
16 # |
15 # include <boost/preprocessor/arithmetic/dec.hpp> |
|
16 # include <boost/preprocessor/config/config.hpp> |
17 # include <boost/preprocessor/config/config.hpp> |
17 # include <boost/preprocessor/control/if.hpp> |
|
18 # include <boost/preprocessor/seq/fold_left.hpp> |
|
19 # include <boost/preprocessor/seq/seq.hpp> |
|
20 # include <boost/preprocessor/seq/size.hpp> |
|
21 # include <boost/preprocessor/tuple/eat.hpp> |
|
22 # |
18 # |
23 # /* BOOST_PP_SEQ_CAT */ |
19 # /* BOOST_PP_CAT */ |
24 # |
20 # |
25 # define BOOST_PP_SEQ_CAT(seq) \ |
21 # if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MWCC() |
26 BOOST_PP_IF( \ |
22 # define BOOST_PP_CAT(a, b) BOOST_PP_CAT_I(a, b) |
27 BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(seq)), \ |
23 # else |
28 BOOST_PP_SEQ_CAT_I, \ |
24 # define BOOST_PP_CAT(a, b) BOOST_PP_CAT_OO((a, b)) |
29 BOOST_PP_SEQ_HEAD(seq) BOOST_PP_TUPLE_EAT_1 \ |
25 # define BOOST_PP_CAT_OO(par) BOOST_PP_CAT_I ## par |
30 )(seq) \ |
26 # endif |
31 /**/ |
|
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)) |
|
33 # |
27 # |
34 # define BOOST_PP_SEQ_CAT_O(s, st, elem) BOOST_PP_SEQ_CAT_O_I(st, elem) |
28 # if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MSVC() |
35 # define BOOST_PP_SEQ_CAT_O_I(a, b) a ## b |
29 # define BOOST_PP_CAT_I(a, b) a ## b |
36 # |
30 # else |
37 # /* BOOST_PP_SEQ_CAT_S */ |
31 # define BOOST_PP_CAT_I(a, b) BOOST_PP_CAT_II(a ## b) |
38 # |
32 # define BOOST_PP_CAT_II(res) res |
39 # define BOOST_PP_SEQ_CAT_S(s, seq) \ |
33 # endif |
40 BOOST_PP_IF( \ |
|
41 BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(seq)), \ |
|
42 BOOST_PP_SEQ_CAT_S_I, \ |
|
43 BOOST_PP_SEQ_HEAD(seq) BOOST_PP_TUPLE_EAT_2 \ |
|
44 )(s, seq) \ |
|
45 /**/ |
|
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)) |
|
47 # |
34 # |
48 # endif |
35 # endif |