Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:48:52

0001 # /* **************************************************************************
0002 #  *                                                                          *
0003 #  *     (C) Copyright Paul Mensonides 2011.
0004 #  *     (C) Copyright Edward Diener 2011,2014.
0005 #  *     Distributed under the Boost Software License, Version 1.0. (See
0006 #  *     accompanying file LICENSE_1_0.txt or copy at
0007 #  *     http://www.boost.org/LICENSE_1_0.txt)
0008 #  *                                                                          *
0009 #  ************************************************************************** */
0010 #
0011 # /* See http://www.boost.org for most recent version. */
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 # /* BOOST_PP_LIST_TO_ARRAY */
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 # /* BOOST_PP_LIST_TO_ARRAY_D */
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 /* BOOST_PREPROCESSOR_LIST_TO_ARRAY_HPP */