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: // NO INCLUDE GUARDS, THE HEADER IS INTENDED FOR MULTIPLE INCLUSION! Chris@16: Chris@16: #if !defined(BOOST_MPL_PREPROCESSING_MODE) Chris@16: # include Chris@16: # include Chris@16: # include Chris@16: # include Chris@16: #endif Chris@16: Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: Chris@16: namespace boost { namespace mpl { Chris@16: Chris@16: # define AUX778076_PARAMS(param, sub) \ Chris@16: BOOST_MPL_PP_PARAMS( \ Chris@16: BOOST_MPL_PP_SUB(BOOST_MPL_LIMIT_METAFUNCTION_ARITY, sub) \ Chris@16: , param \ Chris@16: ) \ Chris@16: /**/ Chris@16: Chris@16: # define AUX778076_SHIFTED_PARAMS(param, sub) \ Chris@16: BOOST_MPL_PP_EXT_PARAMS( \ Chris@16: 2, BOOST_MPL_PP_SUB(BOOST_PP_INC(BOOST_MPL_LIMIT_METAFUNCTION_ARITY), sub) \ Chris@16: , param \ Chris@16: ) \ Chris@16: /**/ Chris@16: Chris@16: # define AUX778076_SPEC_PARAMS(param) \ Chris@16: BOOST_MPL_PP_ENUM( \ Chris@16: BOOST_PP_DEC(BOOST_MPL_LIMIT_METAFUNCTION_ARITY) \ Chris@16: , param \ Chris@16: ) \ Chris@16: /**/ Chris@16: Chris@16: namespace aux { Chris@16: Chris@16: #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) Chris@16: Chris@16: template< bool C_, AUX778076_PARAMS(typename T, 1) > Chris@16: struct BOOST_PP_CAT(AUX778076_OP_NAME,impl) Chris@16: : BOOST_PP_CAT(AUX778076_OP_VALUE1,_) Chris@16: { Chris@16: }; Chris@16: Chris@16: template< AUX778076_PARAMS(typename T, 1) > Chris@16: struct BOOST_PP_CAT(AUX778076_OP_NAME,impl)< AUX778076_OP_VALUE2,AUX778076_PARAMS(T, 1) > Chris@16: : BOOST_PP_CAT(AUX778076_OP_NAME,impl)< Chris@16: BOOST_MPL_AUX_NESTED_TYPE_WKND(T1)::value Chris@16: , AUX778076_SHIFTED_PARAMS(T, 1) Chris@16: , BOOST_PP_CAT(AUX778076_OP_VALUE2,_) Chris@16: > Chris@16: { Chris@16: }; Chris@16: Chris@16: template<> Chris@16: struct BOOST_PP_CAT(AUX778076_OP_NAME,impl)< Chris@16: AUX778076_OP_VALUE2 Chris@16: , AUX778076_SPEC_PARAMS(BOOST_PP_CAT(AUX778076_OP_VALUE2,_)) Chris@16: > Chris@16: : BOOST_PP_CAT(AUX778076_OP_VALUE2,_) Chris@16: { Chris@16: }; Chris@16: Chris@16: #else Chris@16: Chris@16: template< bool C_ > struct BOOST_PP_CAT(AUX778076_OP_NAME,impl) Chris@16: { Chris@16: template< AUX778076_PARAMS(typename T, 1) > struct result_ Chris@16: : BOOST_PP_CAT(AUX778076_OP_VALUE1,_) Chris@16: { Chris@16: }; Chris@16: }; Chris@16: Chris@16: template<> struct BOOST_PP_CAT(AUX778076_OP_NAME,impl) Chris@16: { Chris@16: template< AUX778076_PARAMS(typename T, 1) > struct result_ Chris@16: : BOOST_PP_CAT(AUX778076_OP_NAME,impl)< Chris@16: BOOST_MPL_AUX_NESTED_TYPE_WKND(T1)::value Chris@16: >::template result_< AUX778076_SHIFTED_PARAMS(T,1),BOOST_PP_CAT(AUX778076_OP_VALUE2,_) > Chris@16: { Chris@16: }; Chris@16: Chris@16: #if BOOST_WORKAROUND(BOOST_MSVC, == 1300) Chris@16: template<> struct result_ Chris@16: : BOOST_PP_CAT(AUX778076_OP_VALUE2,_) Chris@16: { Chris@16: }; Chris@16: }; Chris@16: #else Chris@16: }; Chris@16: Chris@16: template<> Chris@16: struct BOOST_PP_CAT(AUX778076_OP_NAME,impl) Chris@16: ::result_< AUX778076_SPEC_PARAMS(BOOST_PP_CAT(AUX778076_OP_VALUE2,_)) > Chris@16: : BOOST_PP_CAT(AUX778076_OP_VALUE2,_) Chris@16: { Chris@16: }; Chris@16: #endif // BOOST_MSVC == 1300 Chris@16: Chris@16: #endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION Chris@16: Chris@16: } // namespace aux Chris@16: Chris@16: template< Chris@16: typename BOOST_MPL_AUX_NA_PARAM(T1) Chris@16: , typename BOOST_MPL_AUX_NA_PARAM(T2) Chris@16: BOOST_MPL_PP_DEF_PARAMS_TAIL(2, typename T, BOOST_PP_CAT(AUX778076_OP_VALUE2,_)) Chris@16: > Chris@16: struct AUX778076_OP_NAME Chris@16: #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) Chris@16: : aux::BOOST_PP_CAT(AUX778076_OP_NAME,impl)< Chris@16: BOOST_MPL_AUX_NESTED_TYPE_WKND(T1)::value Chris@16: , AUX778076_SHIFTED_PARAMS(T,0) Chris@16: > Chris@16: #else Chris@16: : aux::BOOST_PP_CAT(AUX778076_OP_NAME,impl)< Chris@16: BOOST_MPL_AUX_NESTED_TYPE_WKND(T1)::value Chris@16: >::template result_< AUX778076_SHIFTED_PARAMS(T,0) > Chris@16: #endif Chris@16: { Chris@16: BOOST_MPL_AUX_LAMBDA_SUPPORT( Chris@16: BOOST_MPL_LIMIT_METAFUNCTION_ARITY Chris@16: , AUX778076_OP_NAME Chris@16: , (AUX778076_PARAMS(T, 0)) Chris@16: ) Chris@16: }; Chris@16: Chris@16: BOOST_MPL_AUX_NA_SPEC2( Chris@16: 2 Chris@16: , BOOST_MPL_LIMIT_METAFUNCTION_ARITY Chris@16: , AUX778076_OP_NAME Chris@16: ) Chris@16: Chris@16: }} Chris@16: Chris@16: #undef AUX778076_SPEC_PARAMS Chris@16: #undef AUX778076_SHIFTED_PARAMS Chris@16: #undef AUX778076_PARAMS Chris@16: #undef AUX778076_OP_NAME Chris@16: #undef AUX778076_OP_VALUE1 Chris@16: #undef AUX778076_OP_VALUE2