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_FIRST_N_HPP
0015 # define BOOST_PREPROCESSOR_LIST_FIRST_N_HPP
0016 #
0017 # include <boost/preprocessor/arithmetic/dec.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/list/reverse.hpp>
0022 # include <boost/preprocessor/tuple/elem.hpp>
0023 # include <boost/preprocessor/tuple/rem.hpp>
0024 #
0025 # /* BOOST_PP_LIST_FIRST_N */
0026 #
0027 # if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
0028 #    define BOOST_PP_LIST_FIRST_N(count, list) BOOST_PP_LIST_REVERSE(BOOST_PP_TUPLE_ELEM(3, 2, BOOST_PP_WHILE(BOOST_PP_LIST_FIRST_N_P, BOOST_PP_LIST_FIRST_N_O, (count, list, BOOST_PP_NIL))))
0029 # else
0030 #    define BOOST_PP_LIST_FIRST_N(count, list) BOOST_PP_LIST_FIRST_N_I(count, list)
0031 #    define BOOST_PP_LIST_FIRST_N_I(count, list) BOOST_PP_LIST_REVERSE(BOOST_PP_TUPLE_ELEM(3, 2, BOOST_PP_WHILE(BOOST_PP_LIST_FIRST_N_P, BOOST_PP_LIST_FIRST_N_O, (count, list, BOOST_PP_NIL))))
0032 # endif
0033 #
0034 # if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
0035 #    define BOOST_PP_LIST_FIRST_N_P(d, data) BOOST_PP_TUPLE_ELEM(3, 0, data)
0036 # else
0037 #    define BOOST_PP_LIST_FIRST_N_P(d, data) BOOST_PP_LIST_FIRST_N_P_I data
0038 #    define BOOST_PP_LIST_FIRST_N_P_I(c, l, nl) c
0039 # endif
0040 #
0041 # if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MWCC()
0042 #    define BOOST_PP_LIST_FIRST_N_O(d, data) BOOST_PP_LIST_FIRST_N_O_D data
0043 # else
0044 #    define BOOST_PP_LIST_FIRST_N_O(d, data) BOOST_PP_LIST_FIRST_N_O_D(BOOST_PP_TUPLE_ELEM(3, 0, data), BOOST_PP_TUPLE_ELEM(3, 1, data), BOOST_PP_TUPLE_ELEM(3, 2, data))
0045 # endif
0046 #
0047 # define BOOST_PP_LIST_FIRST_N_O_D(c, l, nl) (BOOST_PP_DEC(c), BOOST_PP_LIST_REST(l), (BOOST_PP_LIST_FIRST(l), nl))
0048 #
0049 # /* BOOST_PP_LIST_FIRST_N_D */
0050 #
0051 # if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
0052 #    define BOOST_PP_LIST_FIRST_N_D(d, count, list) BOOST_PP_LIST_REVERSE_D(d, BOOST_PP_TUPLE_ELEM(3, 2, BOOST_PP_WHILE_ ## d(BOOST_PP_LIST_FIRST_N_P, BOOST_PP_LIST_FIRST_N_O, (count, list, BOOST_PP_NIL))))
0053 # else
0054 #    define BOOST_PP_LIST_FIRST_N_D(d, count, list) BOOST_PP_LIST_FIRST_N_D_I(d, count, list)
0055 #    define BOOST_PP_LIST_FIRST_N_D_I(d, count, list) BOOST_PP_LIST_REVERSE_D(d, BOOST_PP_TUPLE_ELEM(3, 2, BOOST_PP_WHILE_ ## d(BOOST_PP_LIST_FIRST_N_P, BOOST_PP_LIST_FIRST_N_O, (count, list, BOOST_PP_NIL))))
0056 # endif
0057 #
0058 # endif