Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:39:14

0001 
0002 // Copyright (C) 2009-2012 Lorenzo Caminiti
0003 // Distributed under the Boost Software License, Version 1.0
0004 // (see accompanying file LICENSE_1_0.txt or a copy at
0005 // http://www.boost.org/LICENSE_1_0.txt)
0006 // Home at http://www.boost.org/libs/local_function
0007 
0008 #ifndef BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_PARAMS_HPP_
0009 #define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_PARAMS_HPP_
0010 
0011 #include <boost/local_function/aux_/preprocessor/traits/decl_/index.hpp>
0012 #include <boost/local_function/aux_/preprocessor/traits/param.hpp>
0013 #include <boost/local_function/detail/preprocessor/keyword/default.hpp>
0014 #include <boost/preprocessor/tuple/elem.hpp>
0015 #include <boost/preprocessor/tuple/eat.hpp>
0016 #include <boost/preprocessor/tuple/rem.hpp>
0017 #include <boost/preprocessor/arithmetic/inc.hpp>
0018 #include <boost/preprocessor/control/iif.hpp>
0019 #include <boost/preprocessor/logical/compl.hpp>
0020 #include <boost/preprocessor/facilities/is_empty.hpp>
0021 #include <boost/preprocessor/list/adt.hpp>
0022 #include <boost/preprocessor/list/fold_left.hpp>
0023 
0024 // PRIVATE //
0025 
0026 #define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_PARAMS_DEFAULT_OP_(s, \
0027         default_count, param_traits) \
0028     BOOST_PP_IIF(BOOST_PP_IS_EMPTY( \
0029             BOOST_LOCAL_FUNCTION_AUX_PP_PARAM_TRAITS_DEFAULT(param_traits)), \
0030         BOOST_PP_TUPLE_REM(1) \
0031     , \
0032         BOOST_PP_INC \
0033     )(default_count)
0034 
0035 // Precondition: params is a pp-list which is not nil.
0036 #define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_PARAMS_DEFAULT_COUNT_(params) \
0037     BOOST_PP_LIST_FOLD_LEFT( \
0038             BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_PARAMS_DEFAULT_OP_, \
0039             0 /* start with defaults_count to 0 */, params)
0040 
0041 // PUBLIC //
0042 
0043 // Expand: pp-list of param-traits (no bound variables).
0044 #define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_PARAMS(decl_traits) \
0045     BOOST_PP_TUPLE_ELEM(BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_INDEX_MAX, \
0046             BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_INDEX_PARAMS, decl_traits)
0047 
0048 // Expand: number of parameters with default values (0 if no default).
0049 #define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_PARAMS_DEFAULT_COUNT( \
0050         decl_traits) \
0051     BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS( \
0052             BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_PARAMS(decl_traits)), \
0053         BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_PARAMS_DEFAULT_COUNT_ \
0054     , \
0055         0 BOOST_PP_TUPLE_EAT(1) \
0056     )(BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_PARAMS(decl_traits))
0057 
0058 #endif // #include guard
0059