Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 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 | # |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 12 | # ifndef NDNBOOST_PREPROCESSOR_SEQ_CAT_HPP |
| 13 | # define NDNBOOST_PREPROCESSOR_SEQ_CAT_HPP |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 14 | # |
| 15 | # include <ndnboost/preprocessor/arithmetic/dec.hpp> |
| 16 | # include <ndnboost/preprocessor/config/config.hpp> |
| 17 | # include <ndnboost/preprocessor/control/if.hpp> |
| 18 | # include <ndnboost/preprocessor/seq/fold_left.hpp> |
| 19 | # include <ndnboost/preprocessor/seq/seq.hpp> |
| 20 | # include <ndnboost/preprocessor/seq/size.hpp> |
| 21 | # include <ndnboost/preprocessor/tuple/eat.hpp> |
| 22 | # |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 23 | # /* NDNBOOST_PP_SEQ_CAT */ |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 24 | # |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 25 | # define NDNBOOST_PP_SEQ_CAT(seq) \ |
| 26 | NDNBOOST_PP_IF( \ |
| 27 | NDNBOOST_PP_DEC(NDNBOOST_PP_SEQ_SIZE(seq)), \ |
| 28 | NDNBOOST_PP_SEQ_CAT_I, \ |
| 29 | NDNBOOST_PP_SEQ_HEAD \ |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 30 | )(seq) \ |
| 31 | /**/ |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 32 | # define NDNBOOST_PP_SEQ_CAT_I(seq) NDNBOOST_PP_SEQ_FOLD_LEFT(NDNBOOST_PP_SEQ_CAT_O, NDNBOOST_PP_SEQ_HEAD(seq), NDNBOOST_PP_SEQ_TAIL(seq)) |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 33 | # |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 34 | # define NDNBOOST_PP_SEQ_CAT_O(s, st, elem) NDNBOOST_PP_SEQ_CAT_O_I(st, elem) |
| 35 | # define NDNBOOST_PP_SEQ_CAT_O_I(a, b) a ## b |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 36 | # |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 37 | # /* NDNBOOST_PP_SEQ_CAT_S */ |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 38 | # |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 39 | # define NDNBOOST_PP_SEQ_CAT_S(s, seq) \ |
| 40 | NDNBOOST_PP_IF( \ |
| 41 | NDNBOOST_PP_DEC(NDNBOOST_PP_SEQ_SIZE(seq)), \ |
| 42 | NDNBOOST_PP_SEQ_CAT_S_I_A, \ |
| 43 | NDNBOOST_PP_SEQ_CAT_S_I_B \ |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 44 | )(s, seq) \ |
| 45 | /**/ |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 46 | # define NDNBOOST_PP_SEQ_CAT_S_I_A(s, seq) NDNBOOST_PP_SEQ_FOLD_LEFT_ ## s(NDNBOOST_PP_SEQ_CAT_O, NDNBOOST_PP_SEQ_HEAD(seq), NDNBOOST_PP_SEQ_TAIL(seq)) |
| 47 | # define NDNBOOST_PP_SEQ_CAT_S_I_B(s, seq) NDNBOOST_PP_SEQ_HEAD(seq) |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 48 | # |
| 49 | # endif |