Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -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_FOR_EACH_HPP |
| 13 | # define NDNBOOST_PREPROCESSOR_SEQ_FOR_EACH_HPP |
Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 14 | # |
| 15 | # include <ndnboost/preprocessor/arithmetic/dec.hpp> |
| 16 | # include <ndnboost/preprocessor/config/config.hpp> |
| 17 | # include <ndnboost/preprocessor/repetition/for.hpp> |
| 18 | # include <ndnboost/preprocessor/seq/seq.hpp> |
| 19 | # include <ndnboost/preprocessor/seq/size.hpp> |
| 20 | # include <ndnboost/preprocessor/tuple/elem.hpp> |
| 21 | # include <ndnboost/preprocessor/tuple/rem.hpp> |
| 22 | # |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 23 | # /* NDNBOOST_PP_SEQ_FOR_EACH */ |
Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 24 | # |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 25 | # if ~NDNBOOST_PP_CONFIG_FLAGS() & NDNBOOST_PP_CONFIG_EDG() |
| 26 | # define NDNBOOST_PP_SEQ_FOR_EACH(macro, data, seq) NDNBOOST_PP_FOR((macro, data, seq (nil)), NDNBOOST_PP_SEQ_FOR_EACH_P, NDNBOOST_PP_SEQ_FOR_EACH_O, NDNBOOST_PP_SEQ_FOR_EACH_M) |
Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 27 | # else |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 28 | # define NDNBOOST_PP_SEQ_FOR_EACH(macro, data, seq) NDNBOOST_PP_SEQ_FOR_EACH_D(macro, data, seq) |
| 29 | # define NDNBOOST_PP_SEQ_FOR_EACH_D(macro, data, seq) NDNBOOST_PP_FOR((macro, data, seq (nil)), NDNBOOST_PP_SEQ_FOR_EACH_P, NDNBOOST_PP_SEQ_FOR_EACH_O, NDNBOOST_PP_SEQ_FOR_EACH_M) |
Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 30 | # endif |
| 31 | # |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 32 | # define NDNBOOST_PP_SEQ_FOR_EACH_P(r, x) NDNBOOST_PP_DEC(NDNBOOST_PP_SEQ_SIZE(NDNBOOST_PP_TUPLE_ELEM(3, 2, x))) |
Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 33 | # |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 34 | # if NDNBOOST_PP_CONFIG_FLAGS() & NDNBOOST_PP_CONFIG_STRICT() |
| 35 | # define NDNBOOST_PP_SEQ_FOR_EACH_O(r, x) NDNBOOST_PP_SEQ_FOR_EACH_O_I x |
Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 36 | # else |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 37 | # define NDNBOOST_PP_SEQ_FOR_EACH_O(r, x) NDNBOOST_PP_SEQ_FOR_EACH_O_I(NDNBOOST_PP_TUPLE_ELEM(3, 0, x), NDNBOOST_PP_TUPLE_ELEM(3, 1, x), NDNBOOST_PP_TUPLE_ELEM(3, 2, x)) |
Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 38 | # endif |
| 39 | # |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 40 | # define NDNBOOST_PP_SEQ_FOR_EACH_O_I(macro, data, seq) (macro, data, NDNBOOST_PP_SEQ_TAIL(seq)) |
Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 41 | # |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 42 | # if NDNBOOST_PP_CONFIG_FLAGS() & NDNBOOST_PP_CONFIG_STRICT() |
| 43 | # define NDNBOOST_PP_SEQ_FOR_EACH_M(r, x) NDNBOOST_PP_SEQ_FOR_EACH_M_IM(r, NDNBOOST_PP_TUPLE_REM_3 x) |
| 44 | # define NDNBOOST_PP_SEQ_FOR_EACH_M_IM(r, im) NDNBOOST_PP_SEQ_FOR_EACH_M_I(r, im) |
Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 45 | # else |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 46 | # define NDNBOOST_PP_SEQ_FOR_EACH_M(r, x) NDNBOOST_PP_SEQ_FOR_EACH_M_I(r, NDNBOOST_PP_TUPLE_ELEM(3, 0, x), NDNBOOST_PP_TUPLE_ELEM(3, 1, x), NDNBOOST_PP_TUPLE_ELEM(3, 2, x)) |
Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 47 | # endif |
| 48 | # |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 49 | # define NDNBOOST_PP_SEQ_FOR_EACH_M_I(r, macro, data, seq) macro(r, data, NDNBOOST_PP_SEQ_HEAD(seq)) |
Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 50 | # |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 51 | # /* NDNBOOST_PP_SEQ_FOR_EACH_R */ |
Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 52 | # |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 53 | # if ~NDNBOOST_PP_CONFIG_FLAGS() & NDNBOOST_PP_CONFIG_EDG() |
| 54 | # define NDNBOOST_PP_SEQ_FOR_EACH_R(r, macro, data, seq) NDNBOOST_PP_FOR_ ## r((macro, data, seq (nil)), NDNBOOST_PP_SEQ_FOR_EACH_P, NDNBOOST_PP_SEQ_FOR_EACH_O, NDNBOOST_PP_SEQ_FOR_EACH_M) |
Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 55 | # else |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 56 | # define NDNBOOST_PP_SEQ_FOR_EACH_R(r, macro, data, seq) NDNBOOST_PP_SEQ_FOR_EACH_R_I(r, macro, data, seq) |
| 57 | # define NDNBOOST_PP_SEQ_FOR_EACH_R_I(r, macro, data, seq) NDNBOOST_PP_FOR_ ## r((macro, data, seq (nil)), NDNBOOST_PP_SEQ_FOR_EACH_P, NDNBOOST_PP_SEQ_FOR_EACH_O, NDNBOOST_PP_SEQ_FOR_EACH_M) |
Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 58 | # endif |
| 59 | # |
| 60 | # endif |