1
0
forked from boostorg/mpl

Merge boost/mpl fixes from the trunk

[SVN r55648]
This commit is contained in:
Aleksey Gurtovoy
2009-08-18 05:16:53 +00:00
parent 16dd55a902
commit 4f0675cd13
5 changed files with 16 additions and 18 deletions

View File

@@ -49,7 +49,7 @@ template< \
BOOST_MPL_PP_PARAMS(BOOST_PP_DEC(arity), typename P) \
> \
struct name< BOOST_MPL_PP_PARAMS(BOOST_PP_DEC(arity), P),na > \
: if_< has_push_back<P1> \
: if_< has_push_back< typename clear<P1>::type> \
, aux::name##_impl< \
BOOST_MPL_PP_PARAMS(BOOST_PP_DEC(arity), P) \
, back_inserter< typename clear<P1>::type > \

View File

@@ -25,8 +25,7 @@
namespace boost { namespace mpl {
template< typename Tag >
struct has_push_back_impl;
struct has_push_back_arg;
// agurt 05/feb/04: no default implementation; the stub definition is needed
// to enable the default 'has_push_back' implementation below
@@ -39,7 +38,7 @@ struct 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 )
( boost::is_same< T, has_push_back_arg >::value )
, REQUESTED_PUSH_BACK_SPECIALIZATION_FOR_SEQUENCE_DOES_NOT_EXIST
, ( Sequence )
);
@@ -51,13 +50,13 @@ struct has_push_back_impl
{
template< typename Seq > struct apply
#if !defined(BOOST_MPL_CFG_NO_NESTED_FORWARDING)
: aux::has_type< push_back< Seq, has_push_back_impl<Tag> > >
: aux::has_type< push_back< Seq, has_push_back_arg > >
{
#else
{
typedef aux::has_type< push_back< Seq, has_push_back_impl<Tag> > > type;
typedef aux::has_type< push_back< Seq, has_push_back_arg > > type;
BOOST_STATIC_CONSTANT(bool, value =
(aux::has_type< push_back< Seq, has_push_back_impl<Tag> > >::value)
(aux::has_type< push_back< Seq, has_push_back_arg > >::value)
);
#endif
};

View File

@@ -25,8 +25,7 @@
namespace boost { namespace mpl {
template< typename Tag >
struct has_push_front_impl;
struct has_push_front_arg;
// agurt 05/feb/04: no default implementation; the stub definition is needed
// to enable the default 'has_push_front' implementation below
@@ -40,7 +39,7 @@ struct 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 )
( boost::is_same< T, has_push_front_arg >::value )
, REQUESTED_PUSH_FRONT_SPECIALIZATION_FOR_SEQUENCE_DOES_NOT_EXIST
, ( Sequence )
);
@@ -52,13 +51,13 @@ struct has_push_front_impl
{
template< typename Seq > struct apply
#if !defined(BOOST_MPL_CFG_NO_NESTED_FORWARDING)
: aux::has_type< push_front< Seq, has_push_front_impl<Tag> > >
: aux::has_type< push_front< Seq, has_push_front_arg > >
{
#else
{
typedef aux::has_type< push_front< Seq, has_push_front_impl<Tag> > > type;
typedef aux::has_type< push_front< Seq, has_push_front_arg > > type;
BOOST_STATIC_CONSTANT(bool, value =
(aux::has_type< push_front< Seq, has_push_front_impl<Tag> > >::value)
(aux::has_type< push_front< Seq, has_push_front_arg > >::value)
);
#endif
};

View File

@@ -76,7 +76,7 @@ struct for_each_impl<false>
typedef typename mpl::next<Iterator>::type iter;
for_each_impl<boost::is_same<iter,LastIterator>::value>
::execute((iter*)0, (LastIterator*)0, (TransformFunc*)0, f);
::execute( static_cast<iter*>(0), static_cast<LastIterator*>(0), static_cast<TransformFunc*>(0), f);
}
};
@@ -98,7 +98,7 @@ void for_each(F f, Sequence* = 0, TransformOp* = 0)
typedef typename end<Sequence>::type last;
aux::for_each_impl< boost::is_same<first,last>::value >
::execute((first*)0, (last*)0, (TransformOp*)0, f);
::execute(static_cast<first*>(0), static_cast<last*>(0), static_cast<TransformOp*>(0), f);
}
template<

View File

@@ -44,7 +44,6 @@
#include <boost/preprocessor/repetition/enum_shifted_params.hpp>
#include <boost/preprocessor/repetition/enum_trailing_params.hpp>
#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
#include <iterator>
#include <iterator> // for bidirectional_iterator_tag
#include <climits>
@@ -499,6 +498,7 @@ namespace boost { namespace mpl
, back_ = BOOST_PP_CAT(C, BOOST_PP_DEC(BOOST_MPL_STRING_MAX_PARAMS))
};
typedef char value_type;
typedef string type;
typedef string_tag tag;
};
@@ -541,11 +541,11 @@ namespace boost { namespace mpl
#undef M0
typedef c_str type;
static char const value[];
static typename Sequence::value_type const value[BOOST_MPL_LIMIT_STRING_SIZE+1];
};
template<typename Sequence>
char const c_str<Sequence>::value[] =
typename Sequence::value_type const c_str<Sequence>::value[BOOST_MPL_LIMIT_STRING_SIZE+1] =
{
#define M0(z, n, data) \
mpl::aux_::deref_unless<BOOST_PP_CAT(i, n), iend>::type::value,