]> AND Private Git Repository - canny.git/blob - stc/exp/ml_stc_linux_make_v1.0/include/boost/preprocessor/array/replace.hpp
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
b969113d537aba700f1bd29faace760f921415e9
[canny.git] / stc / exp / ml_stc_linux_make_v1.0 / include / boost / preprocessor / array / replace.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_ARRAY_REPLACE_HPP\r
13 # define BOOST_PREPROCESSOR_ARRAY_REPLACE_HPP\r
14 #\r
15 # include <boost/preprocessor/arithmetic/inc.hpp>\r
16 # include <boost/preprocessor/array/elem.hpp>\r
17 # include <boost/preprocessor/array/push_back.hpp>\r
18 # include <boost/preprocessor/comparison/not_equal.hpp>\r
19 # include <boost/preprocessor/config/config.hpp>\r
20 # include <boost/preprocessor/control/deduce_d.hpp>\r
21 # include <boost/preprocessor/control/iif.hpp>\r
22 # include <boost/preprocessor/control/while.hpp>\r
23 # include <boost/preprocessor/tuple/elem.hpp>\r
24 #\r
25 # /* BOOST_PP_ARRAY_REPLACE */\r
26 #\r
27 # define BOOST_PP_ARRAY_REPLACE(array, i, elem) BOOST_PP_ARRAY_REPLACE_I(BOOST_PP_DEDUCE_D(), array, i, elem)\r
28 # define BOOST_PP_ARRAY_REPLACE_I(d, array, i, elem) BOOST_PP_ARRAY_REPLACE_D(d, array, i, elem)\r
29 #\r
30 # /* BOOST_PP_ARRAY_REPLACE_D */\r
31 #\r
32 # if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()\r
33 #    define BOOST_PP_ARRAY_REPLACE_D(d, array, i, elem) BOOST_PP_TUPLE_ELEM(5, 3, BOOST_PP_WHILE_ ## d(BOOST_PP_ARRAY_REPLACE_P, BOOST_PP_ARRAY_REPLACE_O, (0, i, elem, (0, ()), array)))\r
34 # else\r
35 #    define BOOST_PP_ARRAY_REPLACE_D(d, array, i, elem) BOOST_PP_ARRAY_REPLACE_D_I(d, array, i, elem)\r
36 #    define BOOST_PP_ARRAY_REPLACE_D_I(d, array, i, elem) BOOST_PP_TUPLE_ELEM(5, 3, BOOST_PP_WHILE_ ## d(BOOST_PP_ARRAY_REPLACE_P, BOOST_PP_ARRAY_REPLACE_O, (0, i, elem, (0, ()), array)))\r
37 # endif\r
38 #\r
39 # define BOOST_PP_ARRAY_REPLACE_P(d, state) BOOST_PP_NOT_EQUAL(BOOST_PP_TUPLE_ELEM(5, 0, state), BOOST_PP_ARRAY_SIZE(BOOST_PP_TUPLE_ELEM(5, 4, state)))\r
40 #\r
41 # if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_STRICT()\r
42 #    define BOOST_PP_ARRAY_REPLACE_O(d, state) BOOST_PP_ARRAY_REPLACE_O_I state\r
43 # else\r
44 #    define BOOST_PP_ARRAY_REPLACE_O(d, state) BOOST_PP_ARRAY_REPLACE_O_I(BOOST_PP_TUPLE_ELEM(5, 0, state), BOOST_PP_TUPLE_ELEM(5, 1, state), BOOST_PP_TUPLE_ELEM(5, 2, state), BOOST_PP_TUPLE_ELEM(5, 3, state), BOOST_PP_TUPLE_ELEM(5, 4, state))\r
45 # endif\r
46 #\r
47 # define BOOST_PP_ARRAY_REPLACE_O_I(n, i, elem, res, arr) (BOOST_PP_INC(n), i, elem, BOOST_PP_ARRAY_PUSH_BACK(res, BOOST_PP_IIF(BOOST_PP_NOT_EQUAL(n, i), BOOST_PP_ARRAY_ELEM(n, arr), elem)), arr)\r
48 #\r
49 # endif\r