Chris@16: Chris@16: #if !defined(BOOST_PP_IS_ITERATING) Chris@16: Chris@16: ///// header body 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: #if !defined(BOOST_MPL_PREPROCESSING_MODE) 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: # include Chris@16: # include Chris@16: # include Chris@16: # include Chris@16: #endif Chris@16: Chris@16: #include Chris@16: Chris@16: #if defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \ Chris@16: || defined(BOOST_MPL_PREPROCESSING_MODE) 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: # 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: # include Chris@16: Chris@16: Chris@16: #if !defined(AUX778076_OP_ARITY) Chris@16: # define AUX778076_OP_ARITY BOOST_MPL_LIMIT_METAFUNCTION_ARITY Chris@16: #endif Chris@16: Chris@16: #if !defined(AUX778076_OP_IMPL_NAME) Chris@16: # define AUX778076_OP_IMPL_NAME BOOST_PP_CAT(AUX778076_OP_PREFIX,_impl) Chris@16: #endif Chris@16: Chris@16: #if !defined(AUX778076_OP_TAG_NAME) Chris@16: # define AUX778076_OP_TAG_NAME BOOST_PP_CAT(AUX778076_OP_PREFIX,_tag) Chris@16: #endif Chris@16: Chris@16: namespace boost { namespace mpl { Chris@16: Chris@16: template< Chris@16: typename Tag1 Chris@16: , typename Tag2 Chris@16: #if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) Chris@16: , BOOST_MPL_AUX_NTTP_DECL(int, tag1_) = BOOST_MPL_AUX_MSVC_VALUE_WKND(Tag1)::value Chris@16: , BOOST_MPL_AUX_NTTP_DECL(int, tag2_) = BOOST_MPL_AUX_MSVC_VALUE_WKND(Tag2)::value Chris@16: > Chris@16: struct AUX778076_OP_IMPL_NAME Chris@16: : if_c< Chris@16: ( tag1_ > tag2_ ) Chris@16: #else Chris@16: > Chris@16: struct AUX778076_OP_IMPL_NAME Chris@16: : if_c< Chris@16: ( BOOST_MPL_AUX_NESTED_VALUE_WKND(int, Tag1) Chris@16: > BOOST_MPL_AUX_NESTED_VALUE_WKND(int, Tag2) Chris@16: ) Chris@16: #endif Chris@16: , aux::cast2nd_impl< AUX778076_OP_IMPL_NAME,Tag1,Tag2 > Chris@16: , aux::cast1st_impl< AUX778076_OP_IMPL_NAME,Tag1,Tag2 > Chris@16: >::type Chris@16: { Chris@16: }; Chris@16: Chris@16: /// for Digital Mars C++/compilers with no CTPS/TTP support Chris@16: template<> struct AUX778076_OP_IMPL_NAME Chris@16: { Chris@16: template< typename U1, typename U2 > struct apply Chris@16: { Chris@16: typedef apply type; Chris@16: BOOST_STATIC_CONSTANT(int, value = 0); Chris@16: }; Chris@16: }; Chris@16: Chris@16: #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) Chris@16: template< typename Tag > struct AUX778076_OP_IMPL_NAME Chris@16: { Chris@16: template< typename U1, typename U2 > struct apply Chris@16: { Chris@16: typedef apply type; Chris@16: BOOST_STATIC_CONSTANT(int, value = 0); Chris@16: }; Chris@16: }; Chris@16: Chris@16: template< typename Tag > struct AUX778076_OP_IMPL_NAME Chris@16: { Chris@16: template< typename U1, typename U2 > struct apply Chris@16: { Chris@16: typedef apply type; Chris@16: BOOST_STATIC_CONSTANT(int, value = 0); Chris@16: }; Chris@16: }; Chris@16: #else Chris@16: template<> struct AUX778076_OP_IMPL_NAME Chris@16: { Chris@16: template< typename U1, typename U2 > struct apply Chris@16: { Chris@16: typedef apply type; Chris@16: BOOST_STATIC_CONSTANT(int, value = 0); Chris@16: }; Chris@16: }; Chris@16: Chris@16: template<> struct AUX778076_OP_IMPL_NAME Chris@16: { Chris@16: template< typename U1, typename U2 > struct apply Chris@16: { Chris@16: typedef apply type; Chris@16: BOOST_STATIC_CONSTANT(int, value = 0); Chris@16: }; Chris@16: }; Chris@16: #endif Chris@16: Chris@16: Chris@16: #if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \ Chris@16: && BOOST_WORKAROUND(BOOST_MSVC, >= 1300) Chris@16: template< typename T > struct AUX778076_OP_TAG_NAME Chris@16: : tag Chris@16: { Chris@16: }; Chris@16: #else Chris@16: template< typename T > struct AUX778076_OP_TAG_NAME Chris@16: { Chris@16: typedef typename T::tag type; Chris@16: }; Chris@16: #endif Chris@16: Chris@16: Chris@16: #if AUX778076_OP_ARITY != 2 Chris@16: Chris@16: # if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) Chris@16: Chris@16: # define AUX778076_OP_RIGHT_OPERAND(unused, i, N) , BOOST_PP_CAT(N, BOOST_MPL_PP_ADD(i, 2))> Chris@16: # define AUX778076_OP_N_CALLS(i, N) \ Chris@16: BOOST_MPL_PP_REPEAT( BOOST_PP_DEC(i), BOOST_MPL_PP_REPEAT_IDENTITY_FUNC, AUX778076_OP_NAME< ) \ Chris@16: N1 BOOST_MPL_PP_REPEAT( BOOST_MPL_PP_SUB(i, 1), AUX778076_OP_RIGHT_OPERAND, N ) \ Chris@16: /**/ Chris@16: Chris@16: template< Chris@16: typename BOOST_MPL_AUX_NA_PARAM(N1) Chris@16: , typename BOOST_MPL_AUX_NA_PARAM(N2) Chris@16: BOOST_MPL_PP_DEF_PARAMS_TAIL(2, typename N, na) Chris@16: > Chris@16: struct AUX778076_OP_NAME Chris@16: : AUX778076_OP_N_CALLS(AUX778076_OP_ARITY, N) Chris@16: { Chris@16: BOOST_MPL_AUX_LAMBDA_SUPPORT( Chris@16: AUX778076_OP_ARITY Chris@16: , AUX778076_OP_NAME Chris@16: , ( BOOST_MPL_PP_PARAMS(AUX778076_OP_ARITY, N) ) Chris@16: ) Chris@16: }; Chris@16: Chris@16: #define BOOST_PP_ITERATION_PARAMS_1 \ Chris@16: (3,( BOOST_PP_DEC(AUX778076_OP_ARITY), 2, )) Chris@16: #include BOOST_PP_ITERATE() Chris@16: Chris@16: # undef AUX778076_OP_N_CALLS Chris@16: # undef AUX778076_OP_RIGHT_OPERAND Chris@16: Chris@16: # else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION Chris@16: Chris@16: /// forward declaration Chris@16: template< Chris@16: typename BOOST_MPL_AUX_NA_PARAM(N1) Chris@16: , typename BOOST_MPL_AUX_NA_PARAM(N2) Chris@16: > Chris@16: struct BOOST_PP_CAT(AUX778076_OP_NAME,2); Chris@16: Chris@16: template< Chris@16: typename BOOST_MPL_AUX_NA_PARAM(N1) Chris@16: , typename BOOST_MPL_AUX_NA_PARAM(N2) Chris@16: BOOST_MPL_PP_DEF_PARAMS_TAIL(2, typename N, na) Chris@16: > Chris@16: struct AUX778076_OP_NAME Chris@16: #if BOOST_WORKAROUND(BOOST_MSVC, == 1300) Chris@16: : aux::msvc_eti_base< typename if_< Chris@16: #else Chris@16: : if_< Chris@16: #endif Chris@16: is_na Chris@16: , BOOST_PP_CAT(AUX778076_OP_NAME,2) Chris@16: , AUX778076_OP_NAME< Chris@16: BOOST_PP_CAT(AUX778076_OP_NAME,2) Chris@16: , BOOST_MPL_PP_EXT_PARAMS(3, BOOST_PP_INC(AUX778076_OP_ARITY), N) Chris@16: > Chris@16: >::type Chris@16: #if BOOST_WORKAROUND(BOOST_MSVC, == 1300) Chris@16: > Chris@16: #endif Chris@16: { Chris@16: BOOST_MPL_AUX_LAMBDA_SUPPORT( Chris@16: AUX778076_OP_ARITY Chris@16: , AUX778076_OP_NAME Chris@16: , ( BOOST_MPL_PP_PARAMS(AUX778076_OP_ARITY, N) ) Chris@16: ) Chris@16: }; Chris@16: Chris@16: template< Chris@16: typename N1 Chris@16: , typename N2 Chris@16: > Chris@16: struct BOOST_PP_CAT(AUX778076_OP_NAME,2) Chris@16: Chris@16: #endif Chris@16: Chris@16: #else // AUX778076_OP_ARITY == 2 Chris@16: Chris@16: template< Chris@16: typename BOOST_MPL_AUX_NA_PARAM(N1) Chris@16: , typename BOOST_MPL_AUX_NA_PARAM(N2) Chris@16: > Chris@16: struct AUX778076_OP_NAME Chris@16: Chris@16: #endif Chris@16: Chris@16: #if !defined(BOOST_MPL_CFG_MSVC_ETI_BUG) Chris@16: : AUX778076_OP_IMPL_NAME< Chris@16: typename AUX778076_OP_TAG_NAME::type Chris@16: , typename AUX778076_OP_TAG_NAME::type Chris@16: >::template apply::type Chris@16: #else Chris@16: : aux::msvc_eti_base< typename apply_wrap2< Chris@16: AUX778076_OP_IMPL_NAME< Chris@16: typename AUX778076_OP_TAG_NAME::type Chris@16: , typename AUX778076_OP_TAG_NAME::type Chris@16: > Chris@16: , N1 Chris@16: , N2 Chris@16: >::type >::type Chris@16: #endif Chris@16: { Chris@16: #if AUX778076_OP_ARITY != 2 Chris@16: Chris@16: # if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) Chris@16: BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC( Chris@16: AUX778076_OP_ARITY Chris@16: , AUX778076_OP_NAME Chris@16: , ( BOOST_MPL_PP_PARTIAL_SPEC_PARAMS(2, N, na) ) Chris@16: ) Chris@16: # else Chris@16: BOOST_MPL_AUX_LAMBDA_SUPPORT(2, BOOST_PP_CAT(AUX778076_OP_NAME,2), (N1, N2)) Chris@16: # endif Chris@16: Chris@16: #else Chris@16: BOOST_MPL_AUX_LAMBDA_SUPPORT(2, AUX778076_OP_NAME, (N1, N2)) Chris@16: #endif Chris@16: }; Chris@16: Chris@16: BOOST_MPL_AUX_NA_SPEC2(2, AUX778076_OP_ARITY, AUX778076_OP_NAME) Chris@16: Chris@16: }} Chris@16: Chris@16: #endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS Chris@16: Chris@16: ///// iteration, depth == 1 Chris@16: Chris@16: // For gcc 4.4 compatability, we must include the Chris@16: // BOOST_PP_ITERATION_DEPTH test inside an #else clause. Chris@16: #else // BOOST_PP_IS_ITERATING Chris@16: #if BOOST_PP_ITERATION_DEPTH() == 1 Chris@16: Chris@16: # define i_ BOOST_PP_FRAME_ITERATION(1) Chris@16: Chris@16: template< Chris@16: BOOST_MPL_PP_PARAMS(i_, typename N) Chris@16: > Chris@16: struct AUX778076_OP_NAME Chris@16: #if i_ != 2 Chris@16: : AUX778076_OP_N_CALLS(i_, N) Chris@16: { Chris@16: BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC( Chris@16: AUX778076_OP_ARITY Chris@16: , AUX778076_OP_NAME Chris@16: , ( BOOST_MPL_PP_PARTIAL_SPEC_PARAMS(i_, N, na) ) Chris@16: ) Chris@16: }; Chris@16: #endif Chris@16: Chris@16: # undef i_ Chris@16: Chris@16: #endif // BOOST_PP_ITERATION_DEPTH() Chris@16: #endif // BOOST_PP_IS_ITERATING