Fix default implementation of has_push_back and has_push_front

[SVN r54948]
This commit is contained in:
Steven Watanabe
2009-07-14 16:49:45 +00:00
parent 78364897a1
commit 1ba6d35b4d
5 changed files with 73 additions and 12 deletions
+5 -6
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
};
+5 -6
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
};