Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:41:37

0001 
0002 #ifndef BOOST_MPL_AUX_PREPROCESSOR_DEF_PARAMS_TAIL_HPP_INCLUDED
0003 #define BOOST_MPL_AUX_PREPROCESSOR_DEF_PARAMS_TAIL_HPP_INCLUDED
0004 
0005 // Copyright Aleksey Gurtovoy 2000-2004
0006 //
0007 // Distributed under the Boost Software License, Version 1.0. 
0008 // (See accompanying file LICENSE_1_0.txt or copy at 
0009 // http://www.boost.org/LICENSE_1_0.txt)
0010 //
0011 // See http://www.boost.org/libs/mpl for documentation.
0012 
0013 // $Id$
0014 // $Date$
0015 // $Revision$
0016 
0017 #include <boost/mpl/limits/arity.hpp>
0018 #include <boost/mpl/aux_/config/dtp.hpp>
0019 #include <boost/mpl/aux_/config/preprocessor.hpp>
0020 
0021 #include <boost/preprocessor/comma_if.hpp>
0022 #include <boost/preprocessor/logical/and.hpp>
0023 #include <boost/preprocessor/identity.hpp>
0024 #include <boost/preprocessor/empty.hpp>
0025 
0026 // BOOST_MPL_PP_DEF_PARAMS_TAIL(1,T,value): , T1 = value, .., Tn = value
0027 // BOOST_MPL_PP_DEF_PARAMS_TAIL(2,T,value): , T2 = value, .., Tn = value
0028 // BOOST_MPL_PP_DEF_PARAMS_TAIL(n,T,value): <nothing>
0029 
0030 #if !defined(BOOST_MPL_CFG_NO_OWN_PP_PRIMITIVES)
0031 
0032 #   include <boost/mpl/aux_/preprocessor/filter_params.hpp>
0033 #   include <boost/mpl/aux_/preprocessor/sub.hpp>
0034 
0035 #   define BOOST_MPL_PP_DEF_PARAMS_TAIL_IMPL(i, param, value_func) \
0036     BOOST_MPL_PP_DEF_PARAMS_TAIL_DELAY_1( \
0037           i \
0038         , BOOST_MPL_PP_SUB(BOOST_MPL_LIMIT_METAFUNCTION_ARITY,i) \
0039         , param \
0040         , value_func \
0041         ) \
0042     /**/
0043 
0044 #   define BOOST_MPL_PP_DEF_PARAMS_TAIL_DELAY_1(i, n, param, value_func) \
0045     BOOST_MPL_PP_DEF_PARAMS_TAIL_DELAY_2(i,n,param,value_func) \
0046     /**/
0047 
0048 #   define BOOST_MPL_PP_DEF_PARAMS_TAIL_DELAY_2(i, n, param, value_func) \
0049     BOOST_PP_COMMA_IF(BOOST_PP_AND(i,n)) \
0050     BOOST_MPL_PP_DEF_PARAMS_TAIL_##i(n,param,value_func) \
0051     /**/
0052 
0053 #   define BOOST_MPL_PP_DEF_PARAMS_TAIL_0(i,p,v) BOOST_MPL_PP_FILTER_PARAMS_##i(p##1 v(),p##2 v(),p##3 v(),p##4 v(),p##5 v(),p##6 v(),p##7 v(),p##8 v(),p##9 v())
0054 #   define BOOST_MPL_PP_DEF_PARAMS_TAIL_1(i,p,v) BOOST_MPL_PP_FILTER_PARAMS_##i(p##2 v(),p##3 v(),p##4 v(),p##5 v(),p##6 v(),p##7 v(),p##8 v(),p##9 v(),p1)
0055 #   define BOOST_MPL_PP_DEF_PARAMS_TAIL_2(i,p,v) BOOST_MPL_PP_FILTER_PARAMS_##i(p##3 v(),p##4 v(),p##5 v(),p##6 v(),p##7 v(),p##8 v(),p##9 v(),p1,p2)
0056 #   define BOOST_MPL_PP_DEF_PARAMS_TAIL_3(i,p,v) BOOST_MPL_PP_FILTER_PARAMS_##i(p##4 v(),p##5 v(),p##6 v(),p##7 v(),p##8 v(),p##9 v(),p1,p2,p3)
0057 #   define BOOST_MPL_PP_DEF_PARAMS_TAIL_4(i,p,v) BOOST_MPL_PP_FILTER_PARAMS_##i(p##5 v(),p##6 v(),p##7 v(),p##8 v(),p##9 v(),p1,p2,p3,p4)
0058 #   define BOOST_MPL_PP_DEF_PARAMS_TAIL_5(i,p,v) BOOST_MPL_PP_FILTER_PARAMS_##i(p##6 v(),p##7 v(),p##8 v(),p##9 v(),p1,p2,p3,p4,p5)
0059 #   define BOOST_MPL_PP_DEF_PARAMS_TAIL_6(i,p,v) BOOST_MPL_PP_FILTER_PARAMS_##i(p##7 v(),p##8 v(),p##9 v(),p1,p2,p3,p4,p5,p6)
0060 #   define BOOST_MPL_PP_DEF_PARAMS_TAIL_7(i,p,v) BOOST_MPL_PP_FILTER_PARAMS_##i(p##8 v(),p##9 v(),p1,p2,p3,p4,p5,p6,p7)
0061 #   define BOOST_MPL_PP_DEF_PARAMS_TAIL_8(i,p,v) BOOST_MPL_PP_FILTER_PARAMS_##i(p##9 v(),p1,p2,p3,p4,p5,p6,p7,p8)
0062 #   define BOOST_MPL_PP_DEF_PARAMS_TAIL_9(i,p,v) BOOST_MPL_PP_FILTER_PARAMS_##i(p1,p2,p3,p4,p5,p6,p7,p8,p9)
0063 
0064 #else
0065 
0066 #   include <boost/preprocessor/arithmetic/add.hpp>
0067 #   include <boost/preprocessor/arithmetic/sub.hpp>
0068 #   include <boost/preprocessor/inc.hpp>
0069 #   include <boost/preprocessor/tuple/elem.hpp>
0070 #   include <boost/preprocessor/repeat.hpp>
0071 #   include <boost/preprocessor/cat.hpp>
0072 
0073 #   define BOOST_MPL_PP_AUX_TAIL_PARAM_FUNC(unused, i, op) \
0074     , BOOST_PP_CAT( \
0075           BOOST_PP_TUPLE_ELEM(3, 1, op) \
0076         , BOOST_PP_ADD_D(1, i, BOOST_PP_INC(BOOST_PP_TUPLE_ELEM(3, 0, op))) \
0077         ) BOOST_PP_TUPLE_ELEM(3, 2, op)() \
0078     /**/
0079 
0080 #   define BOOST_MPL_PP_DEF_PARAMS_TAIL_IMPL(i, param, value_func) \
0081     BOOST_PP_REPEAT( \
0082           BOOST_PP_SUB_D(1, BOOST_MPL_LIMIT_METAFUNCTION_ARITY, i) \
0083         , BOOST_MPL_PP_AUX_TAIL_PARAM_FUNC \
0084         , (i, param, value_func) \
0085         ) \
0086     /**/
0087 
0088 
0089 #endif // BOOST_MPL_CFG_NO_OWN_PP_PRIMITIVES
0090 
0091 #define BOOST_MPL_PP_DEF_PARAMS_TAIL(i, param, value) \
0092     BOOST_MPL_PP_DEF_PARAMS_TAIL_IMPL(i, param, BOOST_PP_IDENTITY(=value)) \
0093     /**/
0094 
0095 #if !defined(BOOST_MPL_CFG_NO_DEFAULT_PARAMETERS_IN_NESTED_TEMPLATES)
0096 #   define BOOST_MPL_PP_NESTED_DEF_PARAMS_TAIL(i, param, value) \
0097     BOOST_MPL_PP_DEF_PARAMS_TAIL_IMPL(i, param, BOOST_PP_IDENTITY(=value)) \
0098     /**/
0099 #else
0100 #   define BOOST_MPL_PP_NESTED_DEF_PARAMS_TAIL(i, param, value) \
0101     BOOST_MPL_PP_DEF_PARAMS_TAIL_IMPL(i, param, BOOST_PP_EMPTY) \
0102     /**/
0103 #endif
0104 
0105 #endif // BOOST_MPL_AUX_PREPROCESSOR_DEF_PARAMS_TAIL_HPP_INCLUDED