File indexing completed on 2025-01-18 09:48:52
0001 #
0002
0003
0004
0005
0006
0007
0008
0009
0010 #
0011 #
0012 #
0013 # ifndef BOOST_PREPROCESSOR_LIST_TO_ARRAY_HPP
0014 # define BOOST_PREPROCESSOR_LIST_TO_ARRAY_HPP
0015 #
0016 # include <boost/preprocessor/arithmetic/dec.hpp>
0017 # include <boost/preprocessor/arithmetic/inc.hpp>
0018 # include <boost/preprocessor/config/config.hpp>
0019 # include <boost/preprocessor/control/while.hpp>
0020 # include <boost/preprocessor/list/adt.hpp>
0021 # include <boost/preprocessor/tuple/elem.hpp>
0022 # include <boost/preprocessor/tuple/rem.hpp>
0023 # if BOOST_PP_VARIADICS_MSVC && (_MSC_VER <= 1400)
0024 # include <boost/preprocessor/control/iif.hpp>
0025 # endif
0026 #
0027 #
0028 #
0029 # if BOOST_PP_VARIADICS_MSVC && (_MSC_VER <= 1400)
0030 # define BOOST_PP_LIST_TO_ARRAY(list) \
0031 BOOST_PP_IIF \
0032 ( \
0033 BOOST_PP_LIST_IS_NIL(list), \
0034 BOOST_PP_LIST_TO_ARRAY_VC8ORLESS_EMPTY, \
0035 BOOST_PP_LIST_TO_ARRAY_VC8ORLESS_DO \
0036 ) \
0037 (list) \
0038
0039 # define BOOST_PP_LIST_TO_ARRAY_VC8ORLESS_EMPTY(list) (0,())
0040 # define BOOST_PP_LIST_TO_ARRAY_VC8ORLESS_DO(list) BOOST_PP_LIST_TO_ARRAY_I(BOOST_PP_WHILE, list)
0041 # else
0042 # define BOOST_PP_LIST_TO_ARRAY(list) BOOST_PP_LIST_TO_ARRAY_I(BOOST_PP_WHILE, list)
0043 # endif
0044
0045 # if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MSVC()
0046 # define BOOST_PP_LIST_TO_ARRAY_I(w, list) \
0047 BOOST_PP_LIST_TO_ARRAY_II(((BOOST_PP_TUPLE_REM_CTOR( \
0048 3, \
0049 w(BOOST_PP_LIST_TO_ARRAY_P, BOOST_PP_LIST_TO_ARRAY_O, (list, 1, (~))) \
0050 )))) \
0051
0052 # define BOOST_PP_LIST_TO_ARRAY_II(p) BOOST_PP_LIST_TO_ARRAY_II_B(p)
0053 # define BOOST_PP_LIST_TO_ARRAY_II_B(p) BOOST_PP_LIST_TO_ARRAY_II_C ## p
0054 # define BOOST_PP_LIST_TO_ARRAY_II_C(p) BOOST_PP_LIST_TO_ARRAY_III p
0055 # else
0056 # define BOOST_PP_LIST_TO_ARRAY_I(w, list) \
0057 BOOST_PP_LIST_TO_ARRAY_II(BOOST_PP_TUPLE_REM_CTOR( \
0058 3, \
0059 w(BOOST_PP_LIST_TO_ARRAY_P, BOOST_PP_LIST_TO_ARRAY_O, (list, 1, (~))) \
0060 )) \
0061
0062 # define BOOST_PP_LIST_TO_ARRAY_II(im) BOOST_PP_LIST_TO_ARRAY_III(im)
0063 # endif
0064 # define BOOST_PP_LIST_TO_ARRAY_III(list, size, tuple) (BOOST_PP_DEC(size), BOOST_PP_LIST_TO_ARRAY_IV tuple)
0065 # define BOOST_PP_LIST_TO_ARRAY_IV(_, ...) (__VA_ARGS__)
0066 # define BOOST_PP_LIST_TO_ARRAY_P(d, state) BOOST_PP_LIST_IS_CONS(BOOST_PP_TUPLE_ELEM(3, 0, state))
0067 # define BOOST_PP_LIST_TO_ARRAY_O(d, state) BOOST_PP_LIST_TO_ARRAY_O_I state
0068 # define BOOST_PP_LIST_TO_ARRAY_O_I(list, size, tuple) (BOOST_PP_LIST_REST(list), BOOST_PP_INC(size), (BOOST_PP_TUPLE_REM(size) tuple, BOOST_PP_LIST_FIRST(list)))
0069 #
0070 #
0071 #
0072 # if BOOST_PP_VARIADICS_MSVC && (_MSC_VER <= 1400)
0073 # define BOOST_PP_LIST_TO_ARRAY_D(d, list) \
0074 BOOST_PP_IIF \
0075 ( \
0076 BOOST_PP_LIST_IS_NIL(list), \
0077 BOOST_PP_LIST_TO_ARRAY_D_VC8ORLESS_EMPTY, \
0078 BOOST_PP_LIST_TO_ARRAY_D_VC8ORLESS_DO \
0079 ) \
0080 (d, list) \
0081
0082 # define BOOST_PP_LIST_TO_ARRAY_D_VC8ORLESS_EMPTY(d, list) (0,())
0083 # define BOOST_PP_LIST_TO_ARRAY_D_VC8ORLESS_DO(d, list) BOOST_PP_LIST_TO_ARRAY_I(BOOST_PP_WHILE_ ## d, list)
0084 # else
0085 # define BOOST_PP_LIST_TO_ARRAY_D(d, list) BOOST_PP_LIST_TO_ARRAY_I(BOOST_PP_WHILE_ ## d, list)
0086 # endif
0087 #
0088 # endif