Merge in critical bug fixes from the trunk (r46570, 46546 and 46620)

[SVN r47650]
This commit is contained in:
Aleksey Gurtovoy
2008-07-21 08:00:06 +00:00
parent 4d29901677
commit 0b84aa1225
8 changed files with 71 additions and 28 deletions

View File

@@ -93,8 +93,8 @@ AUX778076_IMPL_SPEC(end, na, void_)
# undef AUX778076_IMPL_SPEC # undef AUX778076_IMPL_SPEC
BOOST_MPL_ALGORITM_TRAITS_LAMBDA_SPEC(1,begin_impl) BOOST_MPL_ALGORITM_TRAITS_LAMBDA_SPEC_IMPL(1,begin_impl)
BOOST_MPL_ALGORITM_TRAITS_LAMBDA_SPEC(1,end_impl) BOOST_MPL_ALGORITM_TRAITS_LAMBDA_SPEC_IMPL(1,end_impl)
}} }}

View File

@@ -2,7 +2,7 @@
#ifndef BOOST_MPL_AUX_PUSH_BACK_IMPL_HPP_INCLUDED #ifndef BOOST_MPL_AUX_PUSH_BACK_IMPL_HPP_INCLUDED
#define BOOST_MPL_AUX_PUSH_BACK_IMPL_HPP_INCLUDED #define BOOST_MPL_AUX_PUSH_BACK_IMPL_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2004 // Copyright Aleksey Gurtovoy 2000-2008
// //
// Distributed under the Boost Software License, Version 1.0. // Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
@@ -15,19 +15,35 @@
// $Revision$ // $Revision$
#include <boost/mpl/push_back_fwd.hpp> #include <boost/mpl/push_back_fwd.hpp>
#include <boost/mpl/assert.hpp>
#include <boost/mpl/aux_/has_type.hpp> #include <boost/mpl/aux_/has_type.hpp>
#include <boost/mpl/aux_/traits_lambda_spec.hpp> #include <boost/mpl/aux_/traits_lambda_spec.hpp>
#include <boost/mpl/aux_/config/forwarding.hpp> #include <boost/mpl/aux_/config/forwarding.hpp>
#include <boost/mpl/aux_/config/static_constant.hpp> #include <boost/mpl/aux_/config/static_constant.hpp>
#include <boost/type_traits/is_same.hpp>
namespace boost { namespace mpl { namespace boost { namespace mpl {
template< typename Tag >
struct has_push_back_impl;
// agurt 05/feb/04: no default implementation; the stub definition is needed // agurt 05/feb/04: no default implementation; the stub definition is needed
// to enable the default 'has_push_back' implementation below // to enable the default 'has_push_back' implementation below
template< typename Tag > template< typename Tag >
struct push_back_impl struct push_back_impl
{ {
template< typename Sequence, typename T > struct apply {}; template< typename Sequence, typename T > struct apply
{
// should be instantiated only in the context of 'has_push_back_impl';
// if you've got an assert here, you are requesting a 'push_back'
// specialization that doesn't exist.
BOOST_MPL_ASSERT_MSG(
( boost::is_same< T, has_push_back_impl<T> >::value )
, REQUESTED_PUSH_BACK_SPECIALIZATION_FOR_SEQUENCE_DOES_NOT_EXIST
, ( Sequence )
);
};
}; };
template< typename Tag > template< typename Tag >
@@ -35,13 +51,13 @@ struct has_push_back_impl
{ {
template< typename Seq > struct apply template< typename Seq > struct apply
#if !defined(BOOST_MPL_CFG_NO_NESTED_FORWARDING) #if !defined(BOOST_MPL_CFG_NO_NESTED_FORWARDING)
: aux::has_type< push_back<Seq,int> > : aux::has_type< push_back< Seq, has_push_back_impl<Tag> > >
{ {
#else #else
{ {
typedef aux::has_type< push_back<Seq,int> > type; typedef aux::has_type< push_back< Seq, has_push_back_impl<Tag> > > type;
BOOST_STATIC_CONSTANT(bool, value = BOOST_STATIC_CONSTANT(bool, value =
(aux::has_type< push_back<Seq,int> >::value) (aux::has_type< push_back< Seq, has_push_back_impl<Tag> > >::value)
); );
#endif #endif
}; };

View File

@@ -2,7 +2,7 @@
#ifndef BOOST_MPL_AUX_PUSH_FRONT_IMPL_HPP_INCLUDED #ifndef BOOST_MPL_AUX_PUSH_FRONT_IMPL_HPP_INCLUDED
#define BOOST_MPL_AUX_PUSH_FRONT_IMPL_HPP_INCLUDED #define BOOST_MPL_AUX_PUSH_FRONT_IMPL_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2004 // Copyright Aleksey Gurtovoy 2000-2008
// //
// Distributed under the Boost Software License, Version 1.0. // Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
@@ -15,20 +15,36 @@
// $Revision$ // $Revision$
#include <boost/mpl/push_front_fwd.hpp> #include <boost/mpl/push_front_fwd.hpp>
#include <boost/mpl/assert.hpp>
#include <boost/mpl/aux_/has_type.hpp> #include <boost/mpl/aux_/has_type.hpp>
#include <boost/mpl/aux_/traits_lambda_spec.hpp> #include <boost/mpl/aux_/traits_lambda_spec.hpp>
#include <boost/mpl/aux_/config/forwarding.hpp> #include <boost/mpl/aux_/config/forwarding.hpp>
#include <boost/mpl/aux_/config/static_constant.hpp> #include <boost/mpl/aux_/config/static_constant.hpp>
#include <boost/type_traits/is_same.hpp>
namespace boost { namespace mpl { namespace boost { namespace mpl {
template< typename Tag >
struct has_push_front_impl;
// agurt 05/feb/04: no default implementation; the stub definition is needed // agurt 05/feb/04: no default implementation; the stub definition is needed
// to enable the default 'has_push_front' implementation below // to enable the default 'has_push_front' implementation below
template< typename Tag > template< typename Tag >
struct push_front_impl struct push_front_impl
{ {
template< typename Sequence, typename T > struct apply {}; template< typename Sequence, typename T > struct apply
{
// should be instantiated only in the context of 'has_push_front_impl';
// if you've got an assert here, you are requesting a 'push_front'
// specialization that doesn't exist.
BOOST_MPL_ASSERT_MSG(
( boost::is_same< T, has_push_front_impl<T> >::value )
, REQUESTED_PUSH_FRONT_SPECIALIZATION_FOR_SEQUENCE_DOES_NOT_EXIST
, ( Sequence )
);
};
}; };
template< typename Tag > template< typename Tag >
@@ -36,13 +52,13 @@ struct has_push_front_impl
{ {
template< typename Seq > struct apply template< typename Seq > struct apply
#if !defined(BOOST_MPL_CFG_NO_NESTED_FORWARDING) #if !defined(BOOST_MPL_CFG_NO_NESTED_FORWARDING)
: aux::has_type< push_front<Seq,int> > : aux::has_type< push_front< Seq, has_push_front_impl<Tag> > >
{ {
#else #else
{ {
typedef aux::has_type< push_front<Seq,int> > type; typedef aux::has_type< push_front< Seq, has_push_front_impl<Tag> > > type;
BOOST_STATIC_CONSTANT(bool, value = BOOST_STATIC_CONSTANT(bool, value =
(aux::has_type< push_front<Seq,int> >::value) (aux::has_type< push_front< Seq, has_push_front_impl<Tag> > >::value)
); );
#endif #endif
}; };

View File

@@ -2,7 +2,7 @@
#ifndef BOOST_MPL_AUX_TRAITS_LAMBDA_SPEC_HPP_INCLUDED #ifndef BOOST_MPL_AUX_TRAITS_LAMBDA_SPEC_HPP_INCLUDED
#define BOOST_MPL_AUX_TRAITS_LAMBDA_SPEC_HPP_INCLUDED #define BOOST_MPL_AUX_TRAITS_LAMBDA_SPEC_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2004 // Copyright Aleksey Gurtovoy 2000-2008
// //
// Distributed under the Boost Software License, Version 1.0. // Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
@@ -14,17 +14,18 @@
// $Date$ // $Date$
// $Revision$ // $Revision$
#include <boost/mpl/sequence_tag_fwd.hpp>
#include <boost/mpl/void.hpp> #include <boost/mpl/void.hpp>
#include <boost/mpl/aux_/preprocessor/params.hpp> #include <boost/mpl/aux_/preprocessor/params.hpp>
#include <boost/mpl/aux_/config/lambda.hpp> #include <boost/mpl/aux_/config/lambda.hpp>
#if !defined(BOOST_MPL_CFG_NO_FULL_LAMBDA_SUPPORT) #if !defined(BOOST_MPL_CFG_NO_FULL_LAMBDA_SUPPORT)
# define BOOST_MPL_ALGORITM_TRAITS_LAMBDA_SPEC(i, trait) /**/ # define BOOST_MPL_ALGORITM_TRAITS_LAMBDA_SPEC_IMPL(i, trait) /**/
#elif !defined(BOOST_MPL_CFG_MSVC_ETI_BUG) #elif !defined(BOOST_MPL_CFG_MSVC_ETI_BUG)
# define BOOST_MPL_ALGORITM_TRAITS_LAMBDA_SPEC(i, trait) \ # define BOOST_MPL_ALGORITM_TRAITS_LAMBDA_SPEC_IMPL(i, trait) \
template<> struct trait<void_> \ template<> struct trait<void_> \
{ \ { \
template< BOOST_MPL_PP_PARAMS(i, typename T) > struct apply \ template< BOOST_MPL_PP_PARAMS(i, typename T) > struct apply \
@@ -35,7 +36,7 @@ template<> struct trait<void_> \
#else #else
# define BOOST_MPL_ALGORITM_TRAITS_LAMBDA_SPEC(i, trait) \ # define BOOST_MPL_ALGORITM_TRAITS_LAMBDA_SPEC_IMPL(i, trait) \
template<> struct trait<void_> \ template<> struct trait<void_> \
{ \ { \
template< BOOST_MPL_PP_PARAMS(i, typename T) > struct apply \ template< BOOST_MPL_PP_PARAMS(i, typename T) > struct apply \
@@ -53,4 +54,10 @@ template<> struct trait<int> \
#endif // BOOST_MPL_CFG_NO_FULL_LAMBDA_SUPPORT #endif // BOOST_MPL_CFG_NO_FULL_LAMBDA_SUPPORT
#define BOOST_MPL_ALGORITM_TRAITS_LAMBDA_SPEC(i, trait) \
BOOST_MPL_ALGORITM_TRAITS_LAMBDA_SPEC_IMPL(i, trait) \
template<> struct trait<non_sequence_tag> {}; \
/**/
#endif // BOOST_MPL_AUX_TRAITS_LAMBDA_SPEC_HPP_INCLUDED #endif // BOOST_MPL_AUX_TRAITS_LAMBDA_SPEC_HPP_INCLUDED

View File

@@ -2,7 +2,7 @@
#ifndef BOOST_MPL_FOR_EACH_HPP_INCLUDED #ifndef BOOST_MPL_FOR_EACH_HPP_INCLUDED
#define BOOST_MPL_FOR_EACH_HPP_INCLUDED #define BOOST_MPL_FOR_EACH_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2004 // Copyright Aleksey Gurtovoy 2000-2008
// //
// Distributed under the Boost Software License, Version 1.0. // Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
@@ -14,12 +14,14 @@
// $Date$ // $Date$
// $Revision$ // $Revision$
#include <boost/mpl/is_sequence.hpp>
#include <boost/mpl/begin_end.hpp> #include <boost/mpl/begin_end.hpp>
#include <boost/mpl/apply.hpp> #include <boost/mpl/apply.hpp>
#include <boost/mpl/bool.hpp> #include <boost/mpl/bool.hpp>
#include <boost/mpl/next_prior.hpp> #include <boost/mpl/next_prior.hpp>
#include <boost/mpl/deref.hpp> #include <boost/mpl/deref.hpp>
#include <boost/mpl/identity.hpp> #include <boost/mpl/identity.hpp>
#include <boost/mpl/assert.hpp>
#include <boost/mpl/aux_/unwrap.hpp> #include <boost/mpl/aux_/unwrap.hpp>
#include <boost/type_traits/is_same.hpp> #include <boost/type_traits/is_same.hpp>
@@ -90,6 +92,8 @@ template<
inline inline
void for_each(F f, Sequence* = 0, TransformOp* = 0) void for_each(F f, Sequence* = 0, TransformOp* = 0)
{ {
BOOST_MPL_ASSERT(( is_sequence<Sequence> ));
typedef typename begin<Sequence>::type first; typedef typename begin<Sequence>::type first;
typedef typename end<Sequence>::type last; typedef typename end<Sequence>::type last;

View File

@@ -1,8 +1,8 @@
#ifndef BOOST_MPL_MAX_HPP_INCLUDED #ifndef BOOST_MPL_MIN_MAX_HPP_INCLUDED
#define BOOST_MPL_MAX_HPP_INCLUDED #define BOOST_MPL_MIN_MAX_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2004 // Copyright Aleksey Gurtovoy 2000-2008
// //
// Distributed under the Boost Software License, Version 1.0. // Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
@@ -43,4 +43,4 @@ BOOST_MPL_AUX_NA_SPEC(2, max)
}} }}
#endif // BOOST_MPL_MAX_HPP_INCLUDED #endif // BOOST_MPL_MIN_MAX_HPP_INCLUDED

View File

@@ -1,8 +1,8 @@
#ifndef BOOST_MPL_LIST_AUX_FRONT_HPP_INCLUDED #ifndef BOOST_MPL_VECTOR_AUX_FRONT_HPP_INCLUDED
#define BOOST_MPL_LIST_AUX_FRONT_HPP_INCLUDED #define BOOST_MPL_VECTOR_AUX_FRONT_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2004 // Copyright Aleksey Gurtovoy 2000-2008
// //
// Distributed under the Boost Software License, Version 1.0. // Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
@@ -53,4 +53,4 @@ struct front_impl< aux::vector_tag<n_> >
}} }}
#endif // BOOST_MPL_LIST_AUX_FRONT_HPP_INCLUDED #endif // BOOST_MPL_VECTOR_AUX_FRONT_HPP_INCLUDED

View File

@@ -37,7 +37,7 @@ struct zip_iterator
typedef zip_iterator< typedef zip_iterator<
typename transform1< typename transform1<
IteratorSeq IteratorSeq
, next<_1> , mpl::next<_1>
>::type >::type
> next; > next;
}; };
@@ -48,8 +48,8 @@ template<
struct zip_view struct zip_view
{ {
private: private:
typedef typename transform1< Sequences, begin<_1> >::type first_ones_; typedef typename transform1< Sequences, mpl::begin<_1> >::type first_ones_;
typedef typename transform1< Sequences, end<_1> >::type last_ones_; typedef typename transform1< Sequences, mpl::end<_1> >::type last_ones_;
public: public:
typedef nested_begin_end_tag tag; typedef nested_begin_end_tag tag;