1 # /* **************************************************************************
3 # * (C) Copyright Paul Mensonides 2002.
4 # * Distributed under the Boost Software License, Version 1.0. (See
5 # * accompanying file LICENSE_1_0.txt or copy at
6 # * http://www.boost.org/LICENSE_1_0.txt)
8 # ************************************************************************** */
10 # /* See http://www.boost.org for most recent version. */
12 # ifndef BOOST_PREPROCESSOR_SEQ_CAT_HPP
13 # define BOOST_PREPROCESSOR_SEQ_CAT_HPP
15 # include <boost/preprocessor/arithmetic/dec.hpp>
16 # 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>
23 # /* BOOST_PP_SEQ_CAT */
25 # define BOOST_PP_SEQ_CAT(seq) \
27 BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(seq)), \
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))
34 # define BOOST_PP_SEQ_CAT_O(s, st, elem) BOOST_PP_SEQ_CAT_O_I(st, elem)
35 # define BOOST_PP_SEQ_CAT_O_I(a, b) a ## b
37 # /* BOOST_PP_SEQ_CAT_S */
39 # define BOOST_PP_SEQ_CAT_S(s, seq) \
41 BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(seq)), \
42 BOOST_PP_SEQ_CAT_S_I_A, \
43 BOOST_PP_SEQ_CAT_S_I_B \
46 # define BOOST_PP_SEQ_CAT_S_I_A(s, seq) BOOST_PP_SEQ_FOLD_LEFT_ ## s(BOOST_PP_SEQ_CAT_O, BOOST_PP_SEQ_HEAD(seq), BOOST_PP_SEQ_TAIL(seq))
47 # define BOOST_PP_SEQ_CAT_S_I_B(s, seq) BOOST_PP_SEQ_HEAD(seq)