]> git.lyx.org Git - lyx.git/blob - boost/boost/preprocessor/seq/filter.hpp
MathML for InsetMathBoldSymbol.
[lyx.git] / boost / boost / preprocessor / seq / filter.hpp
1 # /* **************************************************************************\r
2 #  *                                                                          *\r
3 #  *     (C) Copyright Paul Mensonides 2002.\r
4 #  *     Distributed under the Boost Software License, Version 1.0. (See\r
5 #  *     accompanying file LICENSE_1_0.txt or copy at\r
6 #  *     http://www.boost.org/LICENSE_1_0.txt)\r
7 #  *                                                                          *\r
8 #  ************************************************************************** */\r
9 #\r
10 # /* See http://www.boost.org for most recent version. */\r
11 #\r
12 # ifndef BOOST_PREPROCESSOR_SEQ_FILTER_HPP\r
13 # define BOOST_PREPROCESSOR_SEQ_FILTER_HPP\r
14 #\r
15 # include <boost/preprocessor/config/config.hpp>\r
16 # include <boost/preprocessor/control/expr_if.hpp>\r
17 # include <boost/preprocessor/facilities/empty.hpp>\r
18 # include <boost/preprocessor/seq/fold_left.hpp>\r
19 # include <boost/preprocessor/seq/seq.hpp>\r
20 # include <boost/preprocessor/tuple/elem.hpp>\r
21 # include <boost/preprocessor/tuple/rem.hpp>\r
22 #\r
23 # /* BOOST_PP_SEQ_FILTER */\r
24 #\r
25 # if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()\r
26 #    define BOOST_PP_SEQ_FILTER(pred, data, seq) BOOST_PP_SEQ_TAIL(BOOST_PP_TUPLE_ELEM(3, 2, BOOST_PP_SEQ_FOLD_LEFT(BOOST_PP_SEQ_FILTER_O, (pred, data, (nil)), seq)))\r
27 # else\r
28 #    define BOOST_PP_SEQ_FILTER(pred, data, seq) BOOST_PP_SEQ_FILTER_I(pred, data, seq)\r
29 #    define BOOST_PP_SEQ_FILTER_I(pred, data, seq) BOOST_PP_SEQ_TAIL(BOOST_PP_TUPLE_ELEM(3, 2, BOOST_PP_SEQ_FOLD_LEFT(BOOST_PP_SEQ_FILTER_O, (pred, data, (nil)), seq)))\r
30 # endif\r
31 #\r
32 # if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_STRICT()\r
33 #    define BOOST_PP_SEQ_FILTER_O(s, st, elem) BOOST_PP_SEQ_FILTER_O_IM(s, BOOST_PP_TUPLE_REM_3 st, elem)\r
34 #    define BOOST_PP_SEQ_FILTER_O_IM(s, im, elem) BOOST_PP_SEQ_FILTER_O_I(s, im, elem)\r
35 # else\r
36 #    define BOOST_PP_SEQ_FILTER_O(s, st, elem) BOOST_PP_SEQ_FILTER_O_I(s, BOOST_PP_TUPLE_ELEM(3, 0, st), BOOST_PP_TUPLE_ELEM(3, 1, st), BOOST_PP_TUPLE_ELEM(3, 2, st), elem)\r
37 # endif\r
38 #\r
39 # if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_DMC()\r
40 #   define BOOST_PP_SEQ_FILTER_O_I(s, pred, data, res, elem) (pred, data, res BOOST_PP_EXPR_IF(pred(s, data, elem), (elem)))\r
41 # else\r
42 #   define BOOST_PP_SEQ_FILTER_O_I(s, pred, data, res, elem) (pred, data, res BOOST_PP_EXPR_IF(pred##(s, data, elem), (elem)))\r
43 # endif\r
44 #\r
45 # /* BOOST_PP_SEQ_FILTER_S */\r
46 #\r
47 # if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()\r
48 #    define BOOST_PP_SEQ_FILTER_S(s, pred, data, seq) BOOST_PP_SEQ_TAIL(BOOST_PP_TUPLE_ELEM(3, 2, BOOST_PP_SEQ_FOLD_LEFT_ ## s(BOOST_PP_SEQ_FILTER_O, (pred, data, (nil)), seq)))\r
49 # else\r
50 #    define BOOST_PP_SEQ_FILTER_S(s, pred, data, seq) BOOST_PP_SEQ_FILTER_S_I(s, pred, data, seq)\r
51 #    define BOOST_PP_SEQ_FILTER_S_I(s, pred, data, seq) BOOST_PP_SEQ_TAIL(BOOST_PP_TUPLE_ELEM(3, 2, BOOST_PP_SEQ_FOLD_LEFT_ ## s(BOOST_PP_SEQ_FILTER_O, (pred, data, (nil)), seq)))\r
52 # endif\r
53 #\r
54 # endif\r