Ticket #2069: 0001-boost.mpl-gcc-4.4-fixes.patch

File 0001-boost.mpl-gcc-4.4-fixes.patch, 15.6 KB (added by tim blechmann <tim@…>, 14 years ago)

patch against boost-1.36.0

  • libs/boost/boost/mpl/apply.hpp

    From 36daa30dbec152660988e8e64d0c39ea1622a71c Mon Sep 17 00:00:00 2001
    From: Tim Blechmann <tim@klingt.org>
    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 b  
    88
    99// Copyright Aleksey Gurtovoy 2000-2004
    1010//
    11 // Distributed under the Boost Software License, Version 1.0. 
    12 // (See accompanying file LICENSE_1_0.txt or copy at 
     11// Distributed under the Boost Software License, Version 1.0.
     12// (See accompanying file LICENSE_1_0.txt or copy at
    1313// http://www.boost.org/LICENSE_1_0.txt)
    1414//
    1515// See http://www.boost.org/libs/mpl for documentation.
    namespace boost { namespace mpl {  
    8585    BOOST_PP_COMMA_IF(n) \
    8686    BOOST_MPL_PP_PARTIAL_SPEC_PARAMS(n, param, def) \
    8787    /**/
    88    
     88
    8989#   define AUX778076_APPLY_N_SPEC_PARAMS(n, param) \
    9090    BOOST_MPL_PP_ENUM(BOOST_PP_INC(n), param) \
    9191    /**/
    template<  
    112112      typename F, AUX778076_APPLY_DEF_PARAMS(typename T, na)
    113113    >
    114114struct apply
    115     : aux::apply_chooser< 
     115    : aux::apply_chooser<
    116116          aux::apply_count_args< AUX778076_APPLY_PARAMS(T) >::value
    117117        >::template result_< F, AUX778076_APPLY_PARAMS(T) >::type
    118118{
    struct apply  
    135135
    136136///// iteration, depth == 1
    137137
    138 #elif BOOST_PP_ITERATION_DEPTH() == 1
     138#else
     139#if BOOST_PP_ITERATION_DEPTH() == 1
    139140
    140141#   define i_ BOOST_PP_FRAME_ITERATION(1)
    141142
    template<  
    144145    >
    145146struct BOOST_PP_CAT(apply,i_)
    146147#if !BOOST_WORKAROUND(BOOST_MSVC, < 1300)
    147     : BOOST_PP_CAT(apply_wrap,i_)< 
     148    : BOOST_PP_CAT(apply_wrap,i_)<
    148149          typename lambda<F>::type
    149150        AUX778076_APPLY_N_COMMA_PARAMS(i_, T)
    150151        >
    151152{
    152153#else
    153154{
    154     typedef typename BOOST_PP_CAT(apply_wrap,i_)< 
     155    typedef typename BOOST_PP_CAT(apply_wrap,i_)<
    155156          typename lambda<F>::type
    156157        AUX778076_APPLY_N_COMMA_PARAMS(i_, T)
    157158        >::type type;
    struct apply_chooser<i_>  
    222223
    223224#   undef i_
    224225
     226#endif
    225227#endif // BOOST_PP_IS_ITERATING
  • libs/boost/boost/mpl/apply_wrap.hpp

    diff --git a/libs/boost/boost/mpl/apply_wrap.hpp b/libs/boost/boost/mpl/apply_wrap.hpp
    index ede272a..43cff2a 100644
    a b  
    88
    99// Copyright Aleksey Gurtovoy 2000-2004
    1010//
    11 // Distributed under the Boost Software License, Version 1.0. 
    12 // (See accompanying file LICENSE_1_0.txt or copy at 
     11// Distributed under the Boost Software License, Version 1.0.
     12// (See accompanying file LICENSE_1_0.txt or copy at
    1313// http://www.boost.org/LICENSE_1_0.txt)
    1414//
    1515// See http://www.boost.org/libs/mpl for documentation.
    namespace boost { namespace mpl {  
    7878
    7979///// iteration, depth == 1
    8080
    81 #elif BOOST_PP_ITERATION_DEPTH() == 1
     81#else
     82#if BOOST_PP_ITERATION_DEPTH() == 1
    8283
    8384#   define i_ BOOST_PP_FRAME_ITERATION(1)
    8485
    struct BOOST_PP_CAT(apply_wrap,i_)  
    140141    : F::template apply< AUX778076_APPLY_WRAP_PARAMS(i_, T) >
    141142{
    142143#else
    143 {   
     144{
    144145    typedef typename F::template apply<
    145146         AUX778076_APPLY_WRAP_PARAMS(i_, T)
    146147        >::type type;
    struct BOOST_PP_CAT(apply_wrap,i_)<AUX778076_APPLY_WRAP_SPEC_PARAMS(i_, int)>  
    169170#   undef i_
    170171
    171172///// iteration, depth == 2
    172 
    173 #elif BOOST_PP_ITERATION_DEPTH() == 2
     173#else
     174#if BOOST_PP_ITERATION_DEPTH() == 2
    174175
    175176#   define j_ BOOST_PP_FRAME_ITERATION(2)
    176177
    struct BOOST_PP_CAT(apply_wrap_impl,i_)<  
    197198
    198199#   undef j_
    199200
     201#endif
     202#endif
    200203#endif // BOOST_PP_IS_ITERATING
  • libs/boost/boost/mpl/aux_/full_lambda.hpp

    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 b  
    88
    99// Copyright Aleksey Gurtovoy 2001-2004
    1010//
    11 // Distributed under the Boost Software License, Version 1.0. 
    12 // (See accompanying file LICENSE_1_0.txt or copy at 
     11// Distributed under the Boost Software License, Version 1.0.
     12// (See accompanying file LICENSE_1_0.txt or copy at
    1313// http://www.boost.org/LICENSE_1_0.txt)
    1414//
    1515// See http://www.boost.org/libs/mpl for documentation.
    struct lambda< arg<N>,Tag AUX778076_ARITY_PARAM(int_<-1>) >  
    127127{
    128128    typedef true_ is_le;
    129129    typedef mpl::arg<N> result_; // qualified for the sake of MIPSpro 7.41
    130     typedef mpl::protect<result_> type; 
     130    typedef mpl::protect<result_> type;
    131131};
    132132
    133133
    struct lambda<  
    181181    typedef typename l1::is_le is_le;
    182182    typedef bind1< quote1<aux::template_arity>, typename l1::result_ > arity_;
    183183    typedef lambda< typename if_<is_le,arity_,Arity>::type,Tag2 > l3;
    184    
     184
    185185    typedef aux::le_result3<is_le, Tag2, mpl::lambda, l1, l2, l3> le_result_;
    186186    typedef typename le_result_::result_ result_;
    187187    typedef typename le_result_::type type;
    struct lambda<  
    200200{
    201201    typedef lambda< F,Tag2 > l1;
    202202    typedef lambda< Tag1,Tag2 > l2;
    203    
     203
    204204    typedef typename l1::is_le is_le;
    205205    typedef aux::le_result2<is_le, Tag2, mpl::lambda, l1, l2> le_result_;
    206206    typedef typename le_result_::result_ result_;
    BOOST_MPL_AUX_NA_SPEC2(2, 3, lambda)  
    227227
    228228///// iteration, depth == 1
    229229
    230 #elif BOOST_PP_ITERATION_DEPTH() == 1
     230#else
     231#if BOOST_PP_ITERATION_DEPTH() == 1
    231232#define i_ BOOST_PP_FRAME_ITERATION(1)
    232233
    233234#if i_ > 0
    struct BOOST_PP_CAT(le_result,i_)  
    254255    typedef F<
    255256          BOOST_MPL_PP_REPEAT(i_, AUX778076_TYPE, L)
    256257        > result_;
    257    
     258
    258259    typedef result_ type;
    259260};
    260261
    template<  
    299300    , AUX778076_LAMBDA_PARAMS(i_, typename T)
    300301    , typename Tag
    301302    >
    302 struct lambda< 
     303struct lambda<
    303304          F<AUX778076_LAMBDA_PARAMS(i_, T)>
    304305        , Tag
    305306        AUX778076_ARITY_PARAM(int_<i_>)
    struct lambda<  
    315316    typedef aux::BOOST_PP_CAT(le_result,i_)<
    316317          is_le, Tag, F, AUX778076_LAMBDA_PARAMS(i_, l)
    317318        > le_result_;
    318    
     319
    319320    typedef typename le_result_::result_ result_;
    320321    typedef typename le_result_::type type;
    321322};
    struct lambda<  
    342343          F
    343344        AUX778076_BIND_N_PARAMS(i_, T)
    344345        > result_;
    345        
     346
    346347    typedef result_ type;
    347348};
    348349
    349350#undef i_
     351#endif
    350352#endif // BOOST_PP_IS_ITERATING
  • libs/boost/boost/mpl/aux_/numeric_op.hpp

    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 b  
    77
    88// Copyright Aleksey Gurtovoy 2000-2004
    99//
    10 // Distributed under the Boost Software License, Version 1.0. 
    11 // (See accompanying file LICENSE_1_0.txt or copy at 
     10// Distributed under the Boost Software License, Version 1.0.
     11// (See accompanying file LICENSE_1_0.txt or copy at
    1212// http://www.boost.org/LICENSE_1_0.txt)
    1313//
    1414// See http://www.boost.org/libs/mpl for documentation.
     
    7171
    7272namespace boost { namespace mpl {
    7373
    74 template< 
     74template<
    7575      typename Tag1
    7676    , typename Tag2
    7777#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
    78     , BOOST_MPL_AUX_NTTP_DECL(int, tag1_) = BOOST_MPL_AUX_MSVC_VALUE_WKND(Tag1)::value 
    79     , BOOST_MPL_AUX_NTTP_DECL(int, tag2_) = BOOST_MPL_AUX_MSVC_VALUE_WKND(Tag2)::value 
     78    , BOOST_MPL_AUX_NTTP_DECL(int, tag1_) = BOOST_MPL_AUX_MSVC_VALUE_WKND(Tag1)::value
     79    , BOOST_MPL_AUX_NTTP_DECL(int, tag2_) = BOOST_MPL_AUX_MSVC_VALUE_WKND(Tag2)::value
    8080    >
    8181struct AUX778076_OP_IMPL_NAME
    8282    : if_c<
    struct AUX778076_OP_IMPL_NAME  
    9898/// for Digital Mars C++/compilers with no CTPS/TTP support
    9999template<> struct AUX778076_OP_IMPL_NAME<na,na>
    100100{
    101     template< typename U1, typename U2 > struct apply 
     101    template< typename U1, typename U2 > struct apply
    102102    {
    103103        typedef apply type;
    104104        BOOST_STATIC_CONSTANT(int, value = 0);
    template<> struct AUX778076_OP_IMPL_NAME<na,na>  
    108108#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
    109109template< typename Tag > struct AUX778076_OP_IMPL_NAME<na,Tag>
    110110{
    111     template< typename U1, typename U2 > struct apply 
     111    template< typename U1, typename U2 > struct apply
    112112    {
    113113        typedef apply type;
    114114        BOOST_STATIC_CONSTANT(int, value = 0);
    template< typename Tag > struct AUX778076_OP_IMPL_NAME<na,Tag>  
    117117
    118118template< typename Tag > struct AUX778076_OP_IMPL_NAME<Tag,na>
    119119{
    120     template< typename U1, typename U2 > struct apply 
     120    template< typename U1, typename U2 > struct apply
    121121    {
    122122        typedef apply type;
    123123        BOOST_STATIC_CONSTANT(int, value = 0);
    template< typename Tag > struct AUX778076_OP_IMPL_NAME<Tag,na>  
    126126#else
    127127template<> struct AUX778076_OP_IMPL_NAME<na,integral_c_tag>
    128128{
    129     template< typename U1, typename U2 > struct apply 
     129    template< typename U1, typename U2 > struct apply
    130130    {
    131131        typedef apply type;
    132132        BOOST_STATIC_CONSTANT(int, value = 0);
    template<> struct AUX778076_OP_IMPL_NAME<na,integral_c_tag>  
    135135
    136136template<> struct AUX778076_OP_IMPL_NAME<integral_c_tag,na>
    137137{
    138     template< typename U1, typename U2 > struct apply 
     138    template< typename U1, typename U2 > struct apply
    139139    {
    140140        typedef apply type;
    141141        BOOST_STATIC_CONSTANT(int, value = 0);
    struct AUX778076_OP_NAME  
    193193#   else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
    194194
    195195/// forward declaration
    196 template< 
     196template<
    197197      typename BOOST_MPL_AUX_NA_PARAM(N1)
    198198    , typename BOOST_MPL_AUX_NA_PARAM(N2)
    199199    >
    struct AUX778076_OP_NAME  
    228228        )
    229229};
    230230
    231 template< 
     231template<
    232232      typename N1
    233233    , typename N2
    234234    >
    struct BOOST_PP_CAT(AUX778076_OP_NAME,2)  
    238238
    239239#else // AUX778076_OP_ARITY == 2
    240240
    241 template< 
     241template<
    242242      typename BOOST_MPL_AUX_NA_PARAM(N1)
    243243    , typename BOOST_MPL_AUX_NA_PARAM(N2)
    244244    >
    BOOST_MPL_AUX_NA_SPEC2(2, AUX778076_OP_ARITY, AUX778076_OP_NAME)  
    287287
    288288///// iteration, depth == 1
    289289
    290 #elif BOOST_PP_ITERATION_DEPTH() == 1
     290#else
     291#if BOOST_PP_ITERATION_DEPTH() == 1
    291292
    292293#   define i_ BOOST_PP_FRAME_ITERATION(1)
    293294
    struct AUX778076_OP_NAME<BOOST_MPL_PP_PARTIAL_SPEC_PARAMS(i_, N, na)>  
    308309
    309310#   undef i_
    310311
     312#endif
    311313#endif // BOOST_PP_IS_ITERATING
  • libs/boost/boost/mpl/bind.hpp

    diff --git a/libs/boost/boost/mpl/bind.hpp b/libs/boost/boost/mpl/bind.hpp
    index 8b17bb8..88a1081 100644
    a b  
    99// Copyright Peter Dimov 2001
    1010// Copyright Aleksey Gurtovoy 2001-2004
    1111//
    12 // Distributed under the Boost Software License, Version 1.0. 
    13 // (See accompanying file LICENSE_1_0.txt or copy at 
     12// Distributed under the Boost Software License, Version 1.0.
     13// (See accompanying file LICENSE_1_0.txt or copy at
    1414// http://www.boost.org/LICENSE_1_0.txt)
    1515//
    1616// See http://www.boost.org/libs/mpl for documentation.
     
    3232#   include <boost/mpl/aux_/yes_no.hpp>
    3333#   if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
    3434#       include <boost/type_traits/is_reference.hpp>
    35 #   endif 
     35#   endif
    3636#endif
    3737
    3838#include <boost/mpl/aux_/config/bind.hpp>
    struct resolve_bind_arg< bind<F,AUX778076_BIND_PARAMS(T)>,AUX778076_BIND_PARAMS(  
    173173
    174174#else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
    175175
    176 // agurt, 15/jan/02: it's not a intended to be used as a function class, and 
     176// agurt, 15/jan/02: it's not a intended to be used as a function class, and
    177177// MSVC6.5 has problems with 'apply' name here (the code compiles, but doesn't
    178178// work), so I went with the 'result_' here, and in all other similar cases
    179179template< bool >
    struct resolve_arg_impl  
    185185    };
    186186};
    187187
    188 template<> 
     188template<>
    189189struct resolve_arg_impl<true>
    190190{
    191191    template< typename T, AUX778076_BIND_PARAMS(typename U) > struct result_
    struct resolve_arg_impl<true>  
    200200// for 'resolve_bind_arg'
    201201template< typename T > struct is_bind_template;
    202202
    203 template< 
     203template<
    204204      typename T, AUX778076_BIND_PARAMS(typename U)
    205205    >
    206206struct resolve_bind_arg
    struct resolve_bind_arg  
    211211
    212212#   if !defined(BOOST_MPL_CFG_NO_UNNAMED_PLACEHOLDER_SUPPORT)
    213213
    214 template< typename T > 
     214template< typename T >
    215215struct replace_unnamed_arg_impl
    216216{
    217217    template< typename Arg > struct result_
    struct replace_unnamed_arg_impl  
    221221    };
    222222};
    223223
    224 template<> 
     224template<>
    225225struct replace_unnamed_arg_impl< arg<-1> >
    226226{
    227227    template< typename Arg > struct result_
    struct replace_unnamed_arg_impl< arg<-1> >  
    231231    };
    232232};
    233233
    234 template< typename T, typename Arg > 
     234template< typename T, typename Arg >
    235235struct replace_unnamed_arg
    236236    : replace_unnamed_arg_impl<T>::template result_<Arg>
    237237{
    aux::no_tag is_bind_helper(...);  
    247247template< typename T > aux::no_tag is_bind_helper(protect<T>*);
    248248
    249249// overload for "main" form
    250 // agurt, 15/mar/02: MSVC 6.5 fails to properly resolve the overload 
    251 // in case if we use 'aux::type_wrapper< bind<...> >' here, and all 
     250// agurt, 15/mar/02: MSVC 6.5 fails to properly resolve the overload
     251// in case if we use 'aux::type_wrapper< bind<...> >' here, and all
    252252// 'bind' instantiations form a complete type anyway
    253253#if !defined(BOOST_MPL_CFG_NO_BIND_TEMPLATE)
    254254template<
    struct is_bind_template_impl<false>  
    274274{
    275275    template< typename T > struct result_
    276276    {
    277         BOOST_STATIC_CONSTANT(bool, value = 
    278               sizeof(aux::is_bind_helper(static_cast<T*>(0))) 
     277        BOOST_STATIC_CONSTANT(bool, value =
     278              sizeof(aux::is_bind_helper(static_cast<T*>(0)))
    279279                == sizeof(aux::yes_tag)
    280280            );
    281281    };
    BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(  
    361361
    362362///// iteration, depth == 1
    363363
    364 #elif BOOST_PP_ITERATION_DEPTH() == 1
     364#else
     365#if BOOST_PP_ITERATION_DEPTH() == 1
    365366
    366367#   define i_ BOOST_PP_FRAME_ITERATION(1)
    367368
    template< BOOST_MPL_PP_PARAMS(i_, typename T) > struct AUX778076_SPEC_NAME;  
    376377template<
    377378      typename Tag AUX778076_BIND_N_PARAMS(i_, typename T)
    378379    >
    379 struct BOOST_PP_CAT(bind,i_)< 
     380struct BOOST_PP_CAT(bind,i_)<
    380381      BOOST_PP_CAT(quote,i_)<AUX778076_SPEC_NAME,Tag>
    381382    AUX778076_BIND_N_PARAMS(i_,T)
    382383    >
    struct BOOST_PP_CAT(bind,i_)  
    441442/**/
    442443
    443444        typedef typename BOOST_PP_CAT(apply_wrap,i_)<
    444               f_ 
     445              f_
    445446            BOOST_PP_COMMA_IF(i_) BOOST_MPL_PP_REPEAT(i_, AUX778076_ARG, t)
    446447            >::type type;
    447448
    BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(BOOST_PP_INC(i_), BOOST_PP_CAT(bind,i_))  
    481482
    482483#   if !defined(BOOST_MPL_CFG_NO_BIND_TEMPLATE)
    483484#   if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
    484    
     485
    485486#if i_ == BOOST_MPL_LIMIT_METAFUNCTION_ARITY
    486487/// primary template (not a specialization!)
    487488template<
    struct bind_chooser<i_>  
    528529
    529530///// iteration, depth == 2
    530531
    531 #elif BOOST_PP_ITERATION_DEPTH() == 2
     532#else
     533#if BOOST_PP_ITERATION_DEPTH() == 2
    532534
    533535#   define j_ BOOST_PP_FRAME_ITERATION(2)
    534536#   if !defined(BOOST_MPL_CFG_NO_UNNAMED_PLACEHOLDER_SUPPORT)
    struct bind_chooser<i_>  
    544546#   endif
    545547#   undef j_
    546548
     549#endif
     550#endif
    547551#endif // BOOST_PP_IS_ITERATING