1 # /* **************************************************************************
2 #  *                                                                          *
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)
7 #  *                                                                          *
8 #  ************************************************************************** */
9 #
10 # /* See http://www.boost.org for most recent version. */
11 #
12 # ifndef MSGPACK_PREPROCESSOR_SEQ_CAT_HPP
13 # define MSGPACK_PREPROCESSOR_SEQ_CAT_HPP
14 #
15 # include <rpc/msgpack/preprocessor/arithmetic/dec.hpp>
16 # include <rpc/msgpack/preprocessor/config/config.hpp>
17 # include <rpc/msgpack/preprocessor/control/if.hpp>
18 # include <rpc/msgpack/preprocessor/seq/fold_left.hpp>
19 # include <rpc/msgpack/preprocessor/seq/seq.hpp>
20 # include <rpc/msgpack/preprocessor/seq/size.hpp>
21 # include <rpc/msgpack/preprocessor/tuple/eat.hpp>
22 #
23 # /* MSGPACK_PP_SEQ_CAT */
24 #
25 # define MSGPACK_PP_SEQ_CAT(seq) \
26     MSGPACK_PP_IF( \
27         MSGPACK_PP_DEC(MSGPACK_PP_SEQ_SIZE(seq)), \
28         MSGPACK_PP_SEQ_CAT_I, \
29         MSGPACK_PP_SEQ_HEAD \
30     )(seq) \
31     /**/
32 # define MSGPACK_PP_SEQ_CAT_I(seq) MSGPACK_PP_SEQ_FOLD_LEFT(MSGPACK_PP_SEQ_CAT_O, MSGPACK_PP_SEQ_HEAD(seq), MSGPACK_PP_SEQ_TAIL(seq))
33 #
34 # define MSGPACK_PP_SEQ_CAT_O(s, st, elem) MSGPACK_PP_SEQ_CAT_O_I(st, elem)
35 # define MSGPACK_PP_SEQ_CAT_O_I(a, b) a ## b
36 #
37 # /* MSGPACK_PP_SEQ_CAT_S */
38 #
39 # define MSGPACK_PP_SEQ_CAT_S(s, seq) \
40     MSGPACK_PP_IF( \
41         MSGPACK_PP_DEC(MSGPACK_PP_SEQ_SIZE(seq)), \
42         MSGPACK_PP_SEQ_CAT_S_I_A, \
43         MSGPACK_PP_SEQ_CAT_S_I_B \
44     )(s, seq) \
45     /**/
46 # define MSGPACK_PP_SEQ_CAT_S_I_A(s, seq) MSGPACK_PP_SEQ_FOLD_LEFT_ ## s(MSGPACK_PP_SEQ_CAT_O, MSGPACK_PP_SEQ_HEAD(seq), MSGPACK_PP_SEQ_TAIL(seq))
47 # define MSGPACK_PP_SEQ_CAT_S_I_B(s, seq) MSGPACK_PP_SEQ_HEAD(seq)
48 #
49 # endif
50