From 36daa30dbec152660988e8e64d0c39ea1622a71c Mon Sep 17 00:00:00 2001 From: Tim Blechmann Date: Wed, 20 Aug 2008 10:44:35 +0200 Subject: [PATCH] [boost.mpl] gcc-4.4 fixes --- libs/boost/boost/mpl/apply.hpp | 16 ++++++----- libs/boost/boost/mpl/apply_wrap.hpp | 15 ++++++---- libs/boost/boost/mpl/aux_/full_lambda.hpp | 22 ++++++++------- libs/boost/boost/mpl/aux_/numeric_op.hpp | 30 +++++++++++---------- libs/boost/boost/mpl/bind.hpp | 40 ++++++++++++++++------------- 5 files changed, 68 insertions(+), 55 deletions(-) diff --git a/libs/boost/boost/mpl/apply.hpp b/libs/boost/boost/mpl/apply.hpp index eb7ab65..37cb4af 100644 --- a/libs/boost/boost/mpl/apply.hpp +++ b/libs/boost/boost/mpl/apply.hpp @@ -8,8 +8,8 @@ // Copyright Aleksey Gurtovoy 2000-2004 // -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // See http://www.boost.org/libs/mpl for documentation. @@ -85,7 +85,7 @@ namespace boost { namespace mpl { BOOST_PP_COMMA_IF(n) \ BOOST_MPL_PP_PARTIAL_SPEC_PARAMS(n, param, def) \ /**/ - + # define AUX778076_APPLY_N_SPEC_PARAMS(n, param) \ BOOST_MPL_PP_ENUM(BOOST_PP_INC(n), param) \ /**/ @@ -112,7 +112,7 @@ template< typename F, AUX778076_APPLY_DEF_PARAMS(typename T, na) > struct apply - : aux::apply_chooser< + : aux::apply_chooser< aux::apply_count_args< AUX778076_APPLY_PARAMS(T) >::value >::template result_< F, AUX778076_APPLY_PARAMS(T) >::type { @@ -135,7 +135,8 @@ struct apply ///// iteration, depth == 1 -#elif BOOST_PP_ITERATION_DEPTH() == 1 +#else +#if BOOST_PP_ITERATION_DEPTH() == 1 # define i_ BOOST_PP_FRAME_ITERATION(1) @@ -144,14 +145,14 @@ template< > struct BOOST_PP_CAT(apply,i_) #if !BOOST_WORKAROUND(BOOST_MSVC, < 1300) - : BOOST_PP_CAT(apply_wrap,i_)< + : BOOST_PP_CAT(apply_wrap,i_)< typename lambda::type AUX778076_APPLY_N_COMMA_PARAMS(i_, T) > { #else { - typedef typename BOOST_PP_CAT(apply_wrap,i_)< + typedef typename BOOST_PP_CAT(apply_wrap,i_)< typename lambda::type AUX778076_APPLY_N_COMMA_PARAMS(i_, T) >::type type; @@ -222,4 +223,5 @@ struct apply_chooser # undef i_ +#endif #endif // BOOST_PP_IS_ITERATING diff --git a/libs/boost/boost/mpl/apply_wrap.hpp b/libs/boost/boost/mpl/apply_wrap.hpp index ede272a..43cff2a 100644 --- a/libs/boost/boost/mpl/apply_wrap.hpp +++ b/libs/boost/boost/mpl/apply_wrap.hpp @@ -8,8 +8,8 @@ // Copyright Aleksey Gurtovoy 2000-2004 // -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // See http://www.boost.org/libs/mpl for documentation. @@ -78,7 +78,8 @@ namespace boost { namespace mpl { ///// iteration, depth == 1 -#elif BOOST_PP_ITERATION_DEPTH() == 1 +#else +#if BOOST_PP_ITERATION_DEPTH() == 1 # define i_ BOOST_PP_FRAME_ITERATION(1) @@ -140,7 +141,7 @@ struct BOOST_PP_CAT(apply_wrap,i_) : F::template apply< AUX778076_APPLY_WRAP_PARAMS(i_, T) > { #else -{ +{ typedef typename F::template apply< AUX778076_APPLY_WRAP_PARAMS(i_, T) >::type type; @@ -169,8 +170,8 @@ struct BOOST_PP_CAT(apply_wrap,i_) # undef i_ ///// iteration, depth == 2 - -#elif BOOST_PP_ITERATION_DEPTH() == 2 +#else +#if BOOST_PP_ITERATION_DEPTH() == 2 # define j_ BOOST_PP_FRAME_ITERATION(2) @@ -197,4 +198,6 @@ struct BOOST_PP_CAT(apply_wrap_impl,i_)< # undef j_ +#endif +#endif #endif // BOOST_PP_IS_ITERATING diff --git a/libs/boost/boost/mpl/aux_/full_lambda.hpp b/libs/boost/boost/mpl/aux_/full_lambda.hpp index 3e85edd..86bdcd3 100644 --- a/libs/boost/boost/mpl/aux_/full_lambda.hpp +++ b/libs/boost/boost/mpl/aux_/full_lambda.hpp @@ -8,8 +8,8 @@ // Copyright Aleksey Gurtovoy 2001-2004 // -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // See http://www.boost.org/libs/mpl for documentation. @@ -127,7 +127,7 @@ struct lambda< arg,Tag AUX778076_ARITY_PARAM(int_<-1>) > { typedef true_ is_le; typedef mpl::arg result_; // qualified for the sake of MIPSpro 7.41 - typedef mpl::protect type; + typedef mpl::protect type; }; @@ -181,7 +181,7 @@ struct lambda< typedef typename l1::is_le is_le; typedef bind1< quote1, typename l1::result_ > arity_; typedef lambda< typename if_::type,Tag2 > l3; - + typedef aux::le_result3 le_result_; typedef typename le_result_::result_ result_; typedef typename le_result_::type type; @@ -200,7 +200,7 @@ struct lambda< { typedef lambda< F,Tag2 > l1; typedef lambda< Tag1,Tag2 > l2; - + typedef typename l1::is_le is_le; typedef aux::le_result2 le_result_; typedef typename le_result_::result_ result_; @@ -227,7 +227,8 @@ BOOST_MPL_AUX_NA_SPEC2(2, 3, lambda) ///// iteration, depth == 1 -#elif BOOST_PP_ITERATION_DEPTH() == 1 +#else +#if BOOST_PP_ITERATION_DEPTH() == 1 #define i_ BOOST_PP_FRAME_ITERATION(1) #if i_ > 0 @@ -254,7 +255,7 @@ struct BOOST_PP_CAT(le_result,i_) typedef F< BOOST_MPL_PP_REPEAT(i_, AUX778076_TYPE, L) > result_; - + typedef result_ type; }; @@ -299,7 +300,7 @@ template< , AUX778076_LAMBDA_PARAMS(i_, typename T) , typename Tag > -struct lambda< +struct lambda< F , Tag AUX778076_ARITY_PARAM(int_) @@ -315,7 +316,7 @@ struct lambda< typedef aux::BOOST_PP_CAT(le_result,i_)< is_le, Tag, F, AUX778076_LAMBDA_PARAMS(i_, l) > le_result_; - + typedef typename le_result_::result_ result_; typedef typename le_result_::type type; }; @@ -342,9 +343,10 @@ struct lambda< F AUX778076_BIND_N_PARAMS(i_, T) > result_; - + typedef result_ type; }; #undef i_ +#endif #endif // BOOST_PP_IS_ITERATING diff --git a/libs/boost/boost/mpl/aux_/numeric_op.hpp b/libs/boost/boost/mpl/aux_/numeric_op.hpp index 4737a38..0c4a05e 100644 --- a/libs/boost/boost/mpl/aux_/numeric_op.hpp +++ b/libs/boost/boost/mpl/aux_/numeric_op.hpp @@ -7,8 +7,8 @@ // Copyright Aleksey Gurtovoy 2000-2004 // -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // See http://www.boost.org/libs/mpl for documentation. @@ -71,12 +71,12 @@ namespace boost { namespace mpl { -template< +template< typename Tag1 , typename Tag2 #if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) - , BOOST_MPL_AUX_NTTP_DECL(int, tag1_) = BOOST_MPL_AUX_MSVC_VALUE_WKND(Tag1)::value - , BOOST_MPL_AUX_NTTP_DECL(int, tag2_) = BOOST_MPL_AUX_MSVC_VALUE_WKND(Tag2)::value + , BOOST_MPL_AUX_NTTP_DECL(int, tag1_) = BOOST_MPL_AUX_MSVC_VALUE_WKND(Tag1)::value + , BOOST_MPL_AUX_NTTP_DECL(int, tag2_) = BOOST_MPL_AUX_MSVC_VALUE_WKND(Tag2)::value > struct AUX778076_OP_IMPL_NAME : if_c< @@ -98,7 +98,7 @@ struct AUX778076_OP_IMPL_NAME /// for Digital Mars C++/compilers with no CTPS/TTP support template<> struct AUX778076_OP_IMPL_NAME { - template< typename U1, typename U2 > struct apply + template< typename U1, typename U2 > struct apply { typedef apply type; BOOST_STATIC_CONSTANT(int, value = 0); @@ -108,7 +108,7 @@ template<> struct AUX778076_OP_IMPL_NAME #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) template< typename Tag > struct AUX778076_OP_IMPL_NAME { - template< typename U1, typename U2 > struct apply + template< typename U1, typename U2 > struct apply { typedef apply type; BOOST_STATIC_CONSTANT(int, value = 0); @@ -117,7 +117,7 @@ template< typename Tag > struct AUX778076_OP_IMPL_NAME template< typename Tag > struct AUX778076_OP_IMPL_NAME { - template< typename U1, typename U2 > struct apply + template< typename U1, typename U2 > struct apply { typedef apply type; BOOST_STATIC_CONSTANT(int, value = 0); @@ -126,7 +126,7 @@ template< typename Tag > struct AUX778076_OP_IMPL_NAME #else template<> struct AUX778076_OP_IMPL_NAME { - template< typename U1, typename U2 > struct apply + template< typename U1, typename U2 > struct apply { typedef apply type; BOOST_STATIC_CONSTANT(int, value = 0); @@ -135,7 +135,7 @@ template<> struct AUX778076_OP_IMPL_NAME template<> struct AUX778076_OP_IMPL_NAME { - template< typename U1, typename U2 > struct apply + template< typename U1, typename U2 > struct apply { typedef apply type; BOOST_STATIC_CONSTANT(int, value = 0); @@ -193,7 +193,7 @@ struct AUX778076_OP_NAME # else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION /// forward declaration -template< +template< typename BOOST_MPL_AUX_NA_PARAM(N1) , typename BOOST_MPL_AUX_NA_PARAM(N2) > @@ -228,7 +228,7 @@ struct AUX778076_OP_NAME ) }; -template< +template< typename N1 , typename N2 > @@ -238,7 +238,7 @@ struct BOOST_PP_CAT(AUX778076_OP_NAME,2) #else // AUX778076_OP_ARITY == 2 -template< +template< typename BOOST_MPL_AUX_NA_PARAM(N1) , typename BOOST_MPL_AUX_NA_PARAM(N2) > @@ -287,7 +287,8 @@ BOOST_MPL_AUX_NA_SPEC2(2, AUX778076_OP_ARITY, AUX778076_OP_NAME) ///// iteration, depth == 1 -#elif BOOST_PP_ITERATION_DEPTH() == 1 +#else +#if BOOST_PP_ITERATION_DEPTH() == 1 # define i_ BOOST_PP_FRAME_ITERATION(1) @@ -308,4 +309,5 @@ struct AUX778076_OP_NAME # undef i_ +#endif #endif // BOOST_PP_IS_ITERATING diff --git a/libs/boost/boost/mpl/bind.hpp b/libs/boost/boost/mpl/bind.hpp index 8b17bb8..88a1081 100644 --- a/libs/boost/boost/mpl/bind.hpp +++ b/libs/boost/boost/mpl/bind.hpp @@ -9,8 +9,8 @@ // Copyright Peter Dimov 2001 // Copyright Aleksey Gurtovoy 2001-2004 // -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // See http://www.boost.org/libs/mpl for documentation. @@ -32,7 +32,7 @@ # include # if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) # include -# endif +# endif #endif #include @@ -173,7 +173,7 @@ struct resolve_bind_arg< bind,AUX778076_BIND_PARAMS( #else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION -// agurt, 15/jan/02: it's not a intended to be used as a function class, and +// agurt, 15/jan/02: it's not a intended to be used as a function class, and // MSVC6.5 has problems with 'apply' name here (the code compiles, but doesn't // work), so I went with the 'result_' here, and in all other similar cases template< bool > @@ -185,7 +185,7 @@ struct resolve_arg_impl }; }; -template<> +template<> struct resolve_arg_impl { template< typename T, AUX778076_BIND_PARAMS(typename U) > struct result_ @@ -200,7 +200,7 @@ struct resolve_arg_impl // for 'resolve_bind_arg' template< typename T > struct is_bind_template; -template< +template< typename T, AUX778076_BIND_PARAMS(typename U) > struct resolve_bind_arg @@ -211,7 +211,7 @@ struct resolve_bind_arg # if !defined(BOOST_MPL_CFG_NO_UNNAMED_PLACEHOLDER_SUPPORT) -template< typename T > +template< typename T > struct replace_unnamed_arg_impl { template< typename Arg > struct result_ @@ -221,7 +221,7 @@ struct replace_unnamed_arg_impl }; }; -template<> +template<> struct replace_unnamed_arg_impl< arg<-1> > { template< typename Arg > struct result_ @@ -231,7 +231,7 @@ struct replace_unnamed_arg_impl< arg<-1> > }; }; -template< typename T, typename Arg > +template< typename T, typename Arg > struct replace_unnamed_arg : replace_unnamed_arg_impl::template result_ { @@ -247,8 +247,8 @@ aux::no_tag is_bind_helper(...); template< typename T > aux::no_tag is_bind_helper(protect*); // overload for "main" form -// agurt, 15/mar/02: MSVC 6.5 fails to properly resolve the overload -// in case if we use 'aux::type_wrapper< bind<...> >' here, and all +// agurt, 15/mar/02: MSVC 6.5 fails to properly resolve the overload +// in case if we use 'aux::type_wrapper< bind<...> >' here, and all // 'bind' instantiations form a complete type anyway #if !defined(BOOST_MPL_CFG_NO_BIND_TEMPLATE) template< @@ -274,8 +274,8 @@ struct is_bind_template_impl { template< typename T > struct result_ { - BOOST_STATIC_CONSTANT(bool, value = - sizeof(aux::is_bind_helper(static_cast(0))) + BOOST_STATIC_CONSTANT(bool, value = + sizeof(aux::is_bind_helper(static_cast(0))) == sizeof(aux::yes_tag) ); }; @@ -361,7 +361,8 @@ BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC( ///// iteration, depth == 1 -#elif BOOST_PP_ITERATION_DEPTH() == 1 +#else +#if BOOST_PP_ITERATION_DEPTH() == 1 # define i_ BOOST_PP_FRAME_ITERATION(1) @@ -376,7 +377,7 @@ template< BOOST_MPL_PP_PARAMS(i_, typename T) > struct AUX778076_SPEC_NAME; template< typename Tag AUX778076_BIND_N_PARAMS(i_, typename T) > -struct BOOST_PP_CAT(bind,i_)< +struct BOOST_PP_CAT(bind,i_)< BOOST_PP_CAT(quote,i_) AUX778076_BIND_N_PARAMS(i_,T) > @@ -441,7 +442,7 @@ struct BOOST_PP_CAT(bind,i_) /**/ typedef typename BOOST_PP_CAT(apply_wrap,i_)< - f_ + f_ BOOST_PP_COMMA_IF(i_) BOOST_MPL_PP_REPEAT(i_, AUX778076_ARG, t) >::type type; @@ -481,7 +482,7 @@ BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(BOOST_PP_INC(i_), BOOST_PP_CAT(bind,i_)) # if !defined(BOOST_MPL_CFG_NO_BIND_TEMPLATE) # if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) - + #if i_ == BOOST_MPL_LIMIT_METAFUNCTION_ARITY /// primary template (not a specialization!) template< @@ -528,7 +529,8 @@ struct bind_chooser ///// iteration, depth == 2 -#elif BOOST_PP_ITERATION_DEPTH() == 2 +#else +#if BOOST_PP_ITERATION_DEPTH() == 2 # define j_ BOOST_PP_FRAME_ITERATION(2) # if !defined(BOOST_MPL_CFG_NO_UNNAMED_PLACEHOLDER_SUPPORT) @@ -544,4 +546,6 @@ struct bind_chooser # endif # undef j_ +#endif +#endif #endif // BOOST_PP_IS_ITERATING -- 1.5.4.3