File indexing completed on 2025-01-18 09:48:07
0001 #
0002
0003
0004
0005
0006
0007
0008
0009 #
0010 #
0011 #
0012 #
0013 #
0014 # ifndef BOOST_PREPROCESSOR_ARRAY_REMOVE_HPP
0015 # define BOOST_PREPROCESSOR_ARRAY_REMOVE_HPP
0016 #
0017 # include <boost/preprocessor/config/config.hpp>
0018 #
0019 # if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_STRICT()
0020 #
0021 # include <boost/preprocessor/arithmetic/inc.hpp>
0022 # include <boost/preprocessor/array/elem.hpp>
0023 # include <boost/preprocessor/array/push_back.hpp>
0024 # include <boost/preprocessor/array/size.hpp>
0025 # include <boost/preprocessor/comparison/not_equal.hpp>
0026 # include <boost/preprocessor/control/deduce_d.hpp>
0027 # include <boost/preprocessor/control/iif.hpp>
0028 # include <boost/preprocessor/control/while.hpp>
0029 # include <boost/preprocessor/tuple/eat.hpp>
0030 # include <boost/preprocessor/tuple/elem.hpp>
0031 #
0032 #
0033 #
0034 # define BOOST_PP_ARRAY_REMOVE(array, i) BOOST_PP_ARRAY_REMOVE_I(BOOST_PP_DEDUCE_D(), array, i)
0035 # define BOOST_PP_ARRAY_REMOVE_I(d, array, i) BOOST_PP_ARRAY_REMOVE_D(d, array, i)
0036 #
0037 #
0038 #
0039 # if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
0040 # define BOOST_PP_ARRAY_REMOVE_D(d, array, i) BOOST_PP_TUPLE_ELEM(4, 2, BOOST_PP_WHILE_ ## d(BOOST_PP_ARRAY_REMOVE_P, BOOST_PP_ARRAY_REMOVE_O, (0, i, (0, ()), array)))
0041 # else
0042 # define BOOST_PP_ARRAY_REMOVE_D(d, array, i) BOOST_PP_ARRAY_REMOVE_D_I(d, array, i)
0043 # define BOOST_PP_ARRAY_REMOVE_D_I(d, array, i) BOOST_PP_TUPLE_ELEM(4, 2, BOOST_PP_WHILE_ ## d(BOOST_PP_ARRAY_REMOVE_P, BOOST_PP_ARRAY_REMOVE_O, (0, i, (0, ()), array)))
0044 # endif
0045 #
0046 # define BOOST_PP_ARRAY_REMOVE_P(d, st) BOOST_PP_NOT_EQUAL(BOOST_PP_TUPLE_ELEM(4, 0, st), BOOST_PP_ARRAY_SIZE(BOOST_PP_TUPLE_ELEM(4, 3, st)))
0047 #
0048 # if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_STRICT()
0049 # define BOOST_PP_ARRAY_REMOVE_O(d, st) BOOST_PP_ARRAY_REMOVE_O_I st
0050 # else
0051 # define BOOST_PP_ARRAY_REMOVE_O(d, st) BOOST_PP_ARRAY_REMOVE_O_I(BOOST_PP_TUPLE_ELEM(4, 0, st), BOOST_PP_TUPLE_ELEM(4, 1, st), BOOST_PP_TUPLE_ELEM(4, 2, st), BOOST_PP_TUPLE_ELEM(4, 3, st))
0052 # endif
0053 #
0054 # if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_DMC()
0055 # define BOOST_PP_ARRAY_REMOVE_O_I(n, i, res, arr) (BOOST_PP_INC(n), i, BOOST_PP_IIF(BOOST_PP_NOT_EQUAL(n, i), BOOST_PP_ARRAY_PUSH_BACK, res BOOST_PP_TUPLE_EAT_2)(res, BOOST_PP_ARRAY_ELEM(n, arr)), arr)
0056 # else
0057 # define BOOST_PP_ARRAY_REMOVE_O_I(n, i, res, arr) (BOOST_PP_INC(n), i, BOOST_PP_IIF(BOOST_PP_NOT_EQUAL(n, i), BOOST_PP_ARRAY_PUSH_BACK, BOOST_PP_TUPLE_ELEM_2_0)(res, BOOST_PP_ARRAY_ELEM(n, arr)), arr)
0058 # endif
0059 #
0060 # else
0061 #
0062 # include <boost/preprocessor/arithmetic/inc.hpp>
0063 # include <boost/preprocessor/array/elem.hpp>
0064 # include <boost/preprocessor/array/push_back.hpp>
0065 # include <boost/preprocessor/array/size.hpp>
0066 # include <boost/preprocessor/comparison/not_equal.hpp>
0067 # include <boost/preprocessor/control/deduce_d.hpp>
0068 # include <boost/preprocessor/control/iif.hpp>
0069 # include <boost/preprocessor/control/while.hpp>
0070 # if BOOST_PP_LIMIT_TUPLE == 256
0071 # include <boost/preprocessor/logical/not.hpp>
0072 # endif
0073 # include <boost/preprocessor/tuple/eat.hpp>
0074 # include <boost/preprocessor/tuple/elem.hpp>
0075 #
0076 #
0077 #
0078 # define BOOST_PP_ARRAY_REMOVE(array, i) BOOST_PP_ARRAY_REMOVE_I(BOOST_PP_DEDUCE_D(), array, i)
0079 # define BOOST_PP_ARRAY_REMOVE_I(d, array, i) BOOST_PP_ARRAY_REMOVE_D(d, array, i)
0080 #
0081 #
0082 #
0083 # if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
0084 # if BOOST_PP_LIMIT_TUPLE == 256
0085 # define BOOST_PP_ARRAY_REMOVE_D(d, array, i) BOOST_PP_ARRAY_REMOVE_ZERO_D(d, array, i, BOOST_PP_NOT(i))
0086 # else
0087 # define BOOST_PP_ARRAY_REMOVE_D(d, array, i) BOOST_PP_TUPLE_ELEM(4, 2, BOOST_PP_WHILE_ ## d(BOOST_PP_ARRAY_REMOVE_P, BOOST_PP_ARRAY_REMOVE_O, (0, i, (0, ()), array)))
0088 # endif
0089 # else
0090 # define BOOST_PP_ARRAY_REMOVE_D(d, array, i) BOOST_PP_ARRAY_REMOVE_D_I(d, array, i)
0091 # if BOOST_PP_LIMIT_TUPLE == 256
0092 # define BOOST_PP_ARRAY_REMOVE_D_I(d, array, i) BOOST_PP_ARRAY_REMOVE_ZERO_D(d, array, i, BOOST_PP_NOT(i))
0093 # else
0094 # define BOOST_PP_ARRAY_REMOVE_D_I(d, array, i) BOOST_PP_TUPLE_ELEM(4, 2, BOOST_PP_WHILE_ ## d(BOOST_PP_ARRAY_REMOVE_P, BOOST_PP_ARRAY_REMOVE_O, (0, i, (0, ()), array)))
0095 # endif
0096 # endif
0097 #
0098 # if BOOST_PP_LIMIT_TUPLE == 256
0099 # define BOOST_PP_ARRAY_REMOVE_ZERO_D(d, array, i, zero) \
0100 BOOST_PP_TUPLE_ELEM(4, 2, BOOST_PP_WHILE_ ## d(BOOST_PP_ARRAY_REMOVE_P, BOOST_PP_ARRAY_REMOVE_O, \
0101 (1, i, BOOST_PP_IIF(zero,(0, ()),(1, (BOOST_PP_ARRAY_ELEM(0,array)))), array)))
0102 # endif
0103 #
0104 # define BOOST_PP_ARRAY_REMOVE_P(d, st) BOOST_PP_NOT_EQUAL(BOOST_PP_TUPLE_ELEM(4, 0, st), BOOST_PP_ARRAY_SIZE(BOOST_PP_TUPLE_ELEM(4, 3, st)))
0105 #
0106 # if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_STRICT()
0107 # define BOOST_PP_ARRAY_REMOVE_O(d, st) BOOST_PP_ARRAY_REMOVE_O_I st
0108 # else
0109 # define BOOST_PP_ARRAY_REMOVE_O(d, st) BOOST_PP_ARRAY_REMOVE_O_I(BOOST_PP_TUPLE_ELEM(4, 0, st), BOOST_PP_TUPLE_ELEM(4, 1, st), BOOST_PP_TUPLE_ELEM(4, 2, st), BOOST_PP_TUPLE_ELEM(4, 3, st))
0110 # endif
0111 #
0112 # if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_DMC()
0113 # define BOOST_PP_ARRAY_REMOVE_O_I(n, i, res, arr) (BOOST_PP_INC(n), i, BOOST_PP_IIF(BOOST_PP_NOT_EQUAL(n, i), BOOST_PP_ARRAY_PUSH_BACK, res BOOST_PP_TUPLE_EAT_2)(res, BOOST_PP_ARRAY_ELEM(n, arr)), arr)
0114 # else
0115 # define BOOST_PP_ARRAY_REMOVE_O_I(n, i, res, arr) (BOOST_PP_INC(n), i, BOOST_PP_IIF(BOOST_PP_NOT_EQUAL(n, i), BOOST_PP_ARRAY_PUSH_BACK, BOOST_PP_TUPLE_ELEM_2_0)(res, BOOST_PP_ARRAY_ELEM(n, arr)), arr)
0116 # endif
0117 #
0118 # endif
0119 #
0120 # endif