Back to home page

EIC code displayed by LXR

 
 

    


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

0001 # /* Copyright (C) 2001
0002 #  * Housemarque Oy
0003 #  * http://www.housemarque.com
0004 #  *
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 # /* Revised by Paul Mensonides (2002) */
0011 #
0012 # /* See http://www.boost.org for most recent version. */
0013 #
0014 # ifndef BOOST_PREPROCESSOR_LIST_SIZE_HPP
0015 # define BOOST_PREPROCESSOR_LIST_SIZE_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/control/while.hpp>
0023 # include <boost/preprocessor/list/adt.hpp>
0024 # include <boost/preprocessor/tuple/elem.hpp>
0025 # include <boost/preprocessor/tuple/rem.hpp>
0026 #
0027 # /* BOOST_PP_LIST_SIZE */
0028 #
0029 # if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
0030 #    define BOOST_PP_LIST_SIZE(list) BOOST_PP_TUPLE_ELEM(2, 0, BOOST_PP_WHILE(BOOST_PP_LIST_SIZE_P, BOOST_PP_LIST_SIZE_O, (0, list)))
0031 # else
0032 #    define BOOST_PP_LIST_SIZE(list) BOOST_PP_LIST_SIZE_I(list)
0033 #    define BOOST_PP_LIST_SIZE_I(list) BOOST_PP_TUPLE_ELEM(2, 0, BOOST_PP_WHILE(BOOST_PP_LIST_SIZE_P, BOOST_PP_LIST_SIZE_O, (0, list)))
0034 # endif
0035 #
0036 # if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
0037 #    define BOOST_PP_LIST_SIZE_P(d, rl) BOOST_PP_LIST_IS_CONS(BOOST_PP_TUPLE_ELEM(2, 1, rl))
0038 # else
0039 #    define BOOST_PP_LIST_SIZE_P(d, rl) BOOST_PP_LIST_SIZE_P_I(BOOST_PP_TUPLE_REM_2 rl)
0040 #    define BOOST_PP_LIST_SIZE_P_I(im) BOOST_PP_LIST_SIZE_P_II(im)
0041 #    define BOOST_PP_LIST_SIZE_P_II(r, l) BOOST_PP_LIST_IS_CONS(l)
0042 # endif
0043 #
0044 # if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
0045 #    define BOOST_PP_LIST_SIZE_O(d, rl) (BOOST_PP_INC(BOOST_PP_TUPLE_ELEM(2, 0, rl)), BOOST_PP_LIST_REST(BOOST_PP_TUPLE_ELEM(2, 1, rl)))
0046 # else
0047 #    define BOOST_PP_LIST_SIZE_O(d, rl) BOOST_PP_LIST_SIZE_O_I(BOOST_PP_TUPLE_REM_2 rl)
0048 #    define BOOST_PP_LIST_SIZE_O_I(im) BOOST_PP_LIST_SIZE_O_II(im)
0049 #    define BOOST_PP_LIST_SIZE_O_II(r, l) (BOOST_PP_INC(r), BOOST_PP_LIST_REST(l))
0050 # endif
0051 #
0052 # /* BOOST_PP_LIST_SIZE_D */
0053 #
0054 # if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
0055 #    define BOOST_PP_LIST_SIZE_D(d, list) BOOST_PP_TUPLE_ELEM(2, 0, BOOST_PP_WHILE_ ## d(BOOST_PP_LIST_SIZE_P, BOOST_PP_LIST_SIZE_O, (0, list)))
0056 # else
0057 #    define BOOST_PP_LIST_SIZE_D(d, list) BOOST_PP_LIST_SIZE_D_I(d, list)
0058 #    define BOOST_PP_LIST_SIZE_D_I(d, list) BOOST_PP_TUPLE_ELEM(2, 0, BOOST_PP_WHILE_ ## d(BOOST_PP_LIST_SIZE_P, BOOST_PP_LIST_SIZE_O, (0, list)))
0059 # endif
0060 #
0061 # else
0062 #
0063 # include <boost/preprocessor/arithmetic/inc.hpp>
0064 # include <boost/preprocessor/control/iif.hpp>
0065 # include <boost/preprocessor/control/while.hpp>
0066 # include <boost/preprocessor/facilities/identity.hpp>
0067 # include <boost/preprocessor/list/adt.hpp>
0068 # include <boost/preprocessor/tuple/elem.hpp>
0069 # include <boost/preprocessor/tuple/rem.hpp>
0070 #
0071 # /* BOOST_PP_LIST_SIZE */
0072 #
0073 #    define BOOST_PP_LIST_SIZE(list) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(list),BOOST_PP_LIST_SIZE_S,BOOST_PP_IDENTITY_N(0,1))(list)
0074 #    define BOOST_PP_LIST_SIZE_S(list) BOOST_PP_LIST_SIZE_DO(BOOST_PP_LIST_REST(list))
0075 #
0076 # if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
0077 #    define BOOST_PP_LIST_SIZE_DO(list) BOOST_PP_TUPLE_ELEM(2, 0, BOOST_PP_WHILE(BOOST_PP_LIST_SIZE_P, BOOST_PP_LIST_SIZE_O, (1, list)))
0078 # else
0079 #    define BOOST_PP_LIST_SIZE_DO(list) BOOST_PP_LIST_SIZE_I(list)
0080 #    define BOOST_PP_LIST_SIZE_I(list) BOOST_PP_TUPLE_ELEM(2, 0, BOOST_PP_WHILE(BOOST_PP_LIST_SIZE_P, BOOST_PP_LIST_SIZE_O, (1, list)))
0081 # endif
0082 #
0083 # if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
0084 #    define BOOST_PP_LIST_SIZE_P(d, rl) BOOST_PP_LIST_IS_CONS(BOOST_PP_TUPLE_ELEM(2, 1, rl))
0085 # else
0086 #    define BOOST_PP_LIST_SIZE_P(d, rl) BOOST_PP_LIST_SIZE_P_I(BOOST_PP_TUPLE_REM_2 rl)
0087 #    define BOOST_PP_LIST_SIZE_P_I(im) BOOST_PP_LIST_SIZE_P_II(im)
0088 #    define BOOST_PP_LIST_SIZE_P_II(r, l) BOOST_PP_LIST_IS_CONS(l)
0089 # endif
0090 #
0091 # if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
0092 #    define BOOST_PP_LIST_SIZE_O(d, rl) (BOOST_PP_INC(BOOST_PP_TUPLE_ELEM(2, 0, rl)), BOOST_PP_LIST_REST(BOOST_PP_TUPLE_ELEM(2, 1, rl)))
0093 # else
0094 #    define BOOST_PP_LIST_SIZE_O(d, rl) BOOST_PP_LIST_SIZE_O_I(BOOST_PP_TUPLE_REM_2 rl)
0095 #    define BOOST_PP_LIST_SIZE_O_I(im) BOOST_PP_LIST_SIZE_O_II(im)
0096 #    define BOOST_PP_LIST_SIZE_O_II(r, l) (BOOST_PP_INC(r), BOOST_PP_LIST_REST(l))
0097 # endif
0098 #
0099 # /* BOOST_PP_LIST_SIZE_D */
0100 #
0101 #    define BOOST_PP_LIST_SIZE_D(d, list) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(list),BOOST_PP_LIST_SIZE_S_D,BOOST_PP_IDENTITY_N(0,2))(d,list)
0102 #    define BOOST_PP_LIST_SIZE_S_D(d,list) BOOST_PP_LIST_SIZE_DO_D(d,BOOST_PP_LIST_REST(list))
0103 #
0104 # if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
0105 #    define BOOST_PP_LIST_SIZE_DO_D(d, list) BOOST_PP_TUPLE_ELEM(2, 0, BOOST_PP_WHILE_ ## d(BOOST_PP_LIST_SIZE_P, BOOST_PP_LIST_SIZE_O, (1, list)))
0106 # else
0107 #    define BOOST_PP_LIST_SIZE_DO_D(d, list) BOOST_PP_LIST_SIZE_D_I(d, list)
0108 #    define BOOST_PP_LIST_SIZE_D_I(d, list) BOOST_PP_TUPLE_ELEM(2, 0, BOOST_PP_WHILE_ ## d(BOOST_PP_LIST_SIZE_P, BOOST_PP_LIST_SIZE_O, (1, list)))
0109 # endif
0110 #
0111 # endif
0112 #
0113 # endif