Chris@16: Chris@16: // NO INCLUDE GUARDS, THE HEADER IS INTENDED FOR MULTIPLE INCLUSION Chris@16: Chris@16: // Copyright Aleksey Gurtovoy 2000-2004 Chris@16: // Chris@16: // Distributed under the Boost Software License, Version 1.0. Chris@16: // (See accompanying file LICENSE_1_0.txt or copy at Chris@16: // http://www.boost.org/LICENSE_1_0.txt) Chris@16: // Chris@16: // See http://www.boost.org/libs/mpl for documentation. Chris@16: Chris@101: // $Id$ Chris@101: // $Date$ Chris@101: // $Revision$ Chris@16: Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: Chris@16: #if !defined(AUX778076_COUNT_ARGS_PARAM_NAME) Chris@16: # define AUX778076_COUNT_ARGS_PARAM_NAME T Chris@16: #endif Chris@16: Chris@16: #if !defined(AUX778076_COUNT_ARGS_TEMPLATE_PARAM) Chris@16: # define AUX778076_COUNT_ARGS_TEMPLATE_PARAM typename AUX778076_COUNT_ARGS_PARAM_NAME Chris@16: #endif Chris@16: Chris@16: // local macros, #undef-ined at the end of the header Chris@16: Chris@16: #if !defined(AUX778076_COUNT_ARGS_USE_STANDARD_PP_PRIMITIVES) Chris@16: Chris@16: # include Chris@16: # include Chris@16: Chris@16: # define AUX778076_COUNT_ARGS_REPEAT BOOST_MPL_PP_REPEAT Chris@16: # define AUX778076_COUNT_ARGS_PARAMS(param) \ Chris@16: BOOST_MPL_PP_PARAMS( \ Chris@16: AUX778076_COUNT_ARGS_ARITY \ Chris@16: , param \ Chris@16: ) \ Chris@16: /**/ Chris@16: Chris@16: #else Chris@16: Chris@16: # include Chris@16: # include Chris@16: # include Chris@16: Chris@16: # define AUX778076_COUNT_ARGS_REPEAT BOOST_PP_REPEAT Chris@16: # define AUX778076_COUNT_ARGS_PARAMS(param) \ Chris@16: BOOST_PP_ENUM_SHIFTED_PARAMS( \ Chris@16: BOOST_PP_INC(AUX778076_COUNT_ARGS_ARITY) \ Chris@16: , param \ Chris@16: ) \ Chris@16: /**/ Chris@16: Chris@16: #endif // AUX778076_COUNT_ARGS_USE_STANDARD_PP_PRIMITIVES Chris@16: Chris@16: Chris@16: #define AUX778076_IS_ARG_TEMPLATE_NAME \ Chris@16: BOOST_PP_CAT(is_,BOOST_PP_CAT(AUX778076_COUNT_ARGS_PREFIX,_arg)) \ Chris@16: /**/ Chris@16: Chris@16: #define AUX778076_COUNT_ARGS_FUNC(unused, i, param) \ Chris@16: BOOST_PP_EXPR_IF(i, +) \ Chris@16: AUX778076_IS_ARG_TEMPLATE_NAME::value \ Chris@16: /**/ Chris@16: Chris@16: // is__arg Chris@16: template< AUX778076_COUNT_ARGS_TEMPLATE_PARAM > Chris@16: struct AUX778076_IS_ARG_TEMPLATE_NAME Chris@16: { Chris@16: BOOST_STATIC_CONSTANT(bool, value = true); Chris@16: }; Chris@16: Chris@16: template<> Chris@16: struct AUX778076_IS_ARG_TEMPLATE_NAME Chris@16: { Chris@16: BOOST_STATIC_CONSTANT(bool, value = false); Chris@16: }; Chris@16: Chris@16: // _count_args Chris@16: template< Chris@16: AUX778076_COUNT_ARGS_PARAMS(AUX778076_COUNT_ARGS_TEMPLATE_PARAM) Chris@16: > Chris@16: struct BOOST_PP_CAT(AUX778076_COUNT_ARGS_PREFIX,_count_args) Chris@16: { Chris@16: BOOST_STATIC_CONSTANT(int, value = AUX778076_COUNT_ARGS_REPEAT( Chris@16: AUX778076_COUNT_ARGS_ARITY Chris@16: , AUX778076_COUNT_ARGS_FUNC Chris@16: , AUX778076_COUNT_ARGS_PARAM_NAME Chris@16: )); Chris@16: }; Chris@16: Chris@16: #undef AUX778076_COUNT_ARGS_FUNC Chris@16: #undef AUX778076_IS_ARG_TEMPLATE_NAME Chris@16: #undef AUX778076_COUNT_ARGS_PARAMS Chris@16: #undef AUX778076_COUNT_ARGS_REPEAT Chris@16: Chris@16: #undef AUX778076_COUNT_ARGS_ARITY Chris@16: #undef AUX778076_COUNT_ARGS_DEFAULT Chris@16: #undef AUX778076_COUNT_ARGS_PREFIX Chris@16: #undef AUX778076_COUNT_ARGS_USE_STANDARD_PP_PRIMITIVES Chris@16: #undef AUX778076_COUNT_ARGS_TEMPLATE_PARAM Chris@16: #undef AUX778076_COUNT_ARGS_PARAM_NAME