From 7ec3e698d691d904874e9f996286753774b13a33 Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Sun, 25 Nov 2007 18:07:19 +0000 Subject: [PATCH] Full merge from trunk at revision 41356 of entire boost-root tree. [SVN r41369] --- include/boost/mpl/and.hpp | 4 ++ include/boost/mpl/assert.hpp | 59 +++++++++++-------- include/boost/mpl/aux_/begin_end_impl.hpp | 1 + include/boost/mpl/aux_/config/ctps.hpp | 2 +- .../mpl/aux_/config/overload_resolution.hpp | 2 +- include/boost/mpl/aux_/config/pp_counter.hpp | 26 ++++++++ include/boost/mpl/aux_/config/ttp.hpp | 4 +- include/boost/mpl/aux_/integral_wrapper.hpp | 2 +- include/boost/mpl/has_xxx.hpp | 39 ++++++++++++ include/boost/mpl/or.hpp | 4 ++ include/boost/mpl/set/aux_/begin_end_impl.hpp | 4 +- include/boost/mpl/set/aux_/erase_key_impl.hpp | 4 +- include/boost/mpl/set/aux_/insert_impl.hpp | 4 +- include/boost/mpl/set/aux_/item.hpp | 4 +- include/boost/mpl/set/aux_/iterator.hpp | 27 +++++---- include/boost/mpl/set/aux_/set0.hpp | 2 +- 16 files changed, 136 insertions(+), 52 deletions(-) create mode 100644 include/boost/mpl/aux_/config/pp_counter.hpp diff --git a/include/boost/mpl/and.hpp b/include/boost/mpl/and.hpp index 722c7a8..4ec63ee 100644 --- a/include/boost/mpl/and.hpp +++ b/include/boost/mpl/and.hpp @@ -29,21 +29,25 @@ // has to be checked in a separate condition, otherwise GCC complains // about 'and' being an alternative token #if defined(_MSC_VER) +#ifndef __GCCXML__ #if defined(and) # pragma push_macro("and") # undef and # define and(x) #endif #endif +#endif # define BOOST_MPL_PREPROCESSED_HEADER and.hpp # include #if defined(_MSC_VER) +#ifndef __GCCXML__ #if defined(and) # pragma pop_macro("and") #endif #endif +#endif #else diff --git a/include/boost/mpl/assert.hpp b/include/boost/mpl/assert.hpp index 3d2f0e6..7ff190b 100644 --- a/include/boost/mpl/assert.hpp +++ b/include/boost/mpl/assert.hpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -216,7 +217,7 @@ BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE #define BOOST_MPL_ASSERT(pred) \ BOOST_MPL_AUX_ASSERT_CONSTANT( \ std::size_t \ - , BOOST_PP_CAT(mpl_assertion_in_line_,__LINE__) = sizeof( \ + , BOOST_PP_CAT(mpl_assertion_in_line_,BOOST_MPL_AUX_PP_COUNTER()) = sizeof( \ boost::mpl::assertion_failed( \ boost::mpl::assert_arg( (void (*) pred)0, 1 ) \ ) \ @@ -229,7 +230,7 @@ BOOST_MPL_AUX_ASSERT_CONSTANT( \ #if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) # define BOOST_MPL_ASSERT_NOT(pred) \ enum { \ - BOOST_PP_CAT(mpl_assertion_in_line_,__LINE__) = sizeof( \ + BOOST_PP_CAT(mpl_assertion_in_line_,BOOST_MPL_AUX_PP_COUNTER()) = sizeof( \ boost::mpl::assertion::failed( \ boost::mpl::assert_not_arg( (void (*) pred)0, 1 ) \ ) \ @@ -240,7 +241,7 @@ enum { \ # define BOOST_MPL_ASSERT_NOT(pred) \ BOOST_MPL_AUX_ASSERT_CONSTANT( \ std::size_t \ - , BOOST_PP_CAT(mpl_assertion_in_line_,__LINE__) = sizeof( \ + , BOOST_PP_CAT(mpl_assertion_in_line_,BOOST_MPL_AUX_PP_COUNTER()) = sizeof( \ boost::mpl::assertion_failed( \ boost::mpl::assert_not_arg( (void (*) pred)0, 1 ) \ ) \ @@ -255,12 +256,12 @@ BOOST_MPL_AUX_ASSERT_CONSTANT( \ # if !defined(BOOST_MPL_CFG_ASSERT_BROKEN_POINTER_TO_POINTER_TO_MEMBER) // agurt, 9/nov/06: 'enum' below is a workaround for gcc 4.0.4/4.1.1 bugs #29522 and #29518 -# define BOOST_MPL_ASSERT_RELATION(x, rel, y) \ -enum { BOOST_PP_CAT(mpl_assert_rel_value,__LINE__) = (x rel y) }; \ +# define BOOST_MPL_ASSERT_RELATION_IMPL(counter, x, rel, y) \ +enum { BOOST_PP_CAT(mpl_assert_rel_value,counter) = (x rel y) }; \ BOOST_MPL_AUX_ASSERT_CONSTANT( \ std::size_t \ - , BOOST_PP_CAT(mpl_assertion_in_line_,__LINE__) = sizeof( \ - boost::mpl::assertion_failed( \ + , BOOST_PP_CAT(mpl_assertion_in_line_,counter) = sizeof( \ + boost::mpl::assertion_failed( \ (boost::mpl::failed ************ ( boost::mpl::assert_relation< \ boost::mpl::assert_::relations( sizeof( \ boost::mpl::assert_::arg rel boost::mpl::assert_::arg \ @@ -272,20 +273,20 @@ BOOST_MPL_AUX_ASSERT_CONSTANT( \ ) \ /**/ # else -# define BOOST_MPL_ASSERT_RELATION(x, rel, y) \ +# define BOOST_MPL_ASSERT_RELATION_IMPL(counter, x, rel, y) \ BOOST_MPL_AUX_ASSERT_CONSTANT( \ std::size_t \ - , BOOST_PP_CAT(mpl_assert_rel,__LINE__) = sizeof( \ + , BOOST_PP_CAT(mpl_assert_rel,counter) = sizeof( \ boost::mpl::assert_::arg rel boost::mpl::assert_::arg \ ) \ ); \ -BOOST_MPL_AUX_ASSERT_CONSTANT( bool, BOOST_PP_CAT(mpl_assert_rel_value,__LINE__) = (x rel y) ); \ +BOOST_MPL_AUX_ASSERT_CONSTANT( bool, BOOST_PP_CAT(mpl_assert_rel_value,counter) = (x rel y) ); \ BOOST_MPL_AUX_ASSERT_CONSTANT( \ std::size_t \ - , BOOST_PP_CAT(mpl_assertion_in_line_,__LINE__) = sizeof( \ - boost::mpl::assertion_failed( \ + , BOOST_PP_CAT(mpl_assertion_in_line_,counter) = sizeof( \ + boost::mpl::assertion_failed( \ boost::mpl::assert_rel_arg( boost::mpl::assert_relation< \ - boost::mpl::assert_::relations(BOOST_PP_CAT(mpl_assert_rel,__LINE__)) \ + boost::mpl::assert_::relations(BOOST_PP_CAT(mpl_assert_rel,counter)) \ , x \ , y \ >() ) \ @@ -295,13 +296,17 @@ BOOST_MPL_AUX_ASSERT_CONSTANT( \ /**/ # endif +# define BOOST_MPL_ASSERT_RELATION(x, rel, y) \ +BOOST_MPL_ASSERT_RELATION_IMPL(BOOST_MPL_AUX_PP_COUNTER(), x, rel, y) \ +/**/ + #else // !BOOST_MPL_CFG_ASSERT_USE_RELATION_NAMES # if defined(BOOST_MPL_CFG_ASSERT_BROKEN_POINTER_TO_POINTER_TO_MEMBER) # define BOOST_MPL_ASSERT_RELATION(x, rel, y) \ BOOST_MPL_AUX_ASSERT_CONSTANT( \ std::size_t \ - , BOOST_PP_CAT(mpl_assertion_in_line_,__LINE__) = sizeof( \ + , BOOST_PP_CAT(mpl_assertion_in_line_,BOOST_MPL_AUX_PP_COUNTER()) = sizeof( \ boost::mpl::assertion_failed<(x rel y)>( boost::mpl::assert_rel_arg( \ boost::mpl::BOOST_MPL_AUX_ASSERT_RELATION(x,y,(&boost::mpl::operator rel))() \ ) ) \ @@ -312,7 +317,7 @@ BOOST_MPL_AUX_ASSERT_CONSTANT( \ # define BOOST_MPL_ASSERT_RELATION(x, rel, y) \ BOOST_MPL_AUX_ASSERT_CONSTANT( \ std::size_t \ - , BOOST_PP_CAT(mpl_assertion_in_line_,__LINE__) = sizeof( \ + , BOOST_PP_CAT(mpl_assertion_in_line_,BOOST_MPL_AUX_PP_COUNTER()) = sizeof( \ boost::mpl::assertion_failed<(x rel y)>( (boost::mpl::failed ************ ( \ boost::mpl::BOOST_MPL_AUX_ASSERT_RELATION(x,y,(&boost::mpl::operator rel))::************))0 ) \ ) \ @@ -326,36 +331,40 @@ BOOST_MPL_AUX_ASSERT_CONSTANT( \ // BOOST_MPL_ASSERT_MSG( (pred::value), USER_PROVIDED_MESSAGE, (types) ) #if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3202)) -# define BOOST_MPL_ASSERT_MSG( c, msg, types_ ) \ +# define BOOST_MPL_ASSERT_MSG_IMPL( counter, c, msg, types_ ) \ struct msg; \ -typedef struct BOOST_PP_CAT(msg,__LINE__) : boost::mpl::assert_ \ +typedef struct BOOST_PP_CAT(msg,counter) : boost::mpl::assert_ \ { \ using boost::mpl::assert_::types; \ static boost::mpl::failed ************ (msg::************ assert_arg()) types_ \ { return 0; } \ -} BOOST_PP_CAT(mpl_assert_arg,__LINE__); \ +} BOOST_PP_CAT(mpl_assert_arg,counter); \ BOOST_MPL_AUX_ASSERT_CONSTANT( \ std::size_t \ - , BOOST_PP_CAT(mpl_assertion_in_line_,__LINE__) = sizeof( \ - boost::mpl::assertion<(c)>::failed( BOOST_PP_CAT(mpl_assert_arg,__LINE__)::assert_arg() ) \ + , BOOST_PP_CAT(mpl_assertion_in_line_,counter) = sizeof( \ + boost::mpl::assertion<(c)>::failed( BOOST_PP_CAT(mpl_assert_arg,counter)::assert_arg() ) \ ) \ ) \ /**/ #else -# define BOOST_MPL_ASSERT_MSG( c, msg, types_ ) \ +# define BOOST_MPL_ASSERT_MSG_IMPL( counter, c, msg, types_ ) \ struct msg; \ -typedef struct BOOST_PP_CAT(msg,__LINE__) : boost::mpl::assert_ \ +typedef struct BOOST_PP_CAT(msg,counter) : boost::mpl::assert_ \ { \ static boost::mpl::failed ************ (msg::************ assert_arg()) types_ \ { return 0; } \ -} BOOST_PP_CAT(mpl_assert_arg,__LINE__); \ +} BOOST_PP_CAT(mpl_assert_arg,counter); \ BOOST_MPL_AUX_ASSERT_CONSTANT( \ std::size_t \ - , BOOST_PP_CAT(mpl_assertion_in_line_,__LINE__) = sizeof( \ - boost::mpl::assertion_failed<(c)>( BOOST_PP_CAT(mpl_assert_arg,__LINE__)::assert_arg() ) \ + , BOOST_PP_CAT(mpl_assertion_in_line_,counter) = sizeof( \ + boost::mpl::assertion_failed<(c)>( BOOST_PP_CAT(mpl_assert_arg,counter)::assert_arg() ) \ ) \ ) \ /**/ #endif +#define BOOST_MPL_ASSERT_MSG( c, msg, types_ ) \ +BOOST_MPL_ASSERT_MSG_IMPL( BOOST_MPL_AUX_PP_COUNTER(), c, msg, types_ ) \ +/**/ + #endif // BOOST_MPL_ASSERT_HPP_INCLUDED diff --git a/include/boost/mpl/aux_/begin_end_impl.hpp b/include/boost/mpl/aux_/begin_end_impl.hpp index 9fa6912..f7723e9 100644 --- a/include/boost/mpl/aux_/begin_end_impl.hpp +++ b/include/boost/mpl/aux_/begin_end_impl.hpp @@ -25,6 +25,7 @@ namespace boost { namespace mpl { + namespace aux { template< typename Sequence > diff --git a/include/boost/mpl/aux_/config/ctps.hpp b/include/boost/mpl/aux_/config/ctps.hpp index b03657d..75cfaa1 100644 --- a/include/boost/mpl/aux_/config/ctps.hpp +++ b/include/boost/mpl/aux_/config/ctps.hpp @@ -19,7 +19,7 @@ #if !defined(BOOST_MPL_CFG_NO_NONTYPE_TEMPLATE_PARTIAL_SPEC) \ && !defined(BOOST_MPL_PREPROCESSING_MODE) \ - && BOOST_WORKAROUND(__BORLANDC__, < 0x600) + && BOOST_WORKAROUND(__BORLANDC__, < 0x582) # define BOOST_MPL_CFG_NO_NONTYPE_TEMPLATE_PARTIAL_SPEC diff --git a/include/boost/mpl/aux_/config/overload_resolution.hpp b/include/boost/mpl/aux_/config/overload_resolution.hpp index a7618ab..924d07e 100644 --- a/include/boost/mpl/aux_/config/overload_resolution.hpp +++ b/include/boost/mpl/aux_/config/overload_resolution.hpp @@ -18,7 +18,7 @@ #if !defined(BOOST_MPL_CFG_BROKEN_OVERLOAD_RESOLUTION) \ && !defined(BOOST_MPL_PREPROCESSING_MODE) \ - && ( BOOST_WORKAROUND(__BORLANDC__, < 0x600) \ + && ( BOOST_WORKAROUND(__BORLANDC__, < 0x590) \ || BOOST_WORKAROUND(__MWERKS__, < 0x3001) \ ) diff --git a/include/boost/mpl/aux_/config/pp_counter.hpp b/include/boost/mpl/aux_/config/pp_counter.hpp new file mode 100644 index 0000000..cd59aee --- /dev/null +++ b/include/boost/mpl/aux_/config/pp_counter.hpp @@ -0,0 +1,26 @@ + +#ifndef BOOST_MPL_AUX_CONFIG_PP_COUNTER_HPP_INCLUDED +#define BOOST_MPL_AUX_CONFIG_PP_COUNTER_HPP_INCLUDED + +// Copyright Aleksey Gurtovoy 2006 +// +// 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. + +// $Source$ +// $Date$ +// $Revision$ + +#if !defined(BOOST_MPL_AUX_PP_COUNTER) +# include +# if BOOST_WORKAROUND(BOOST_MSVC, >= 1300) +# define BOOST_MPL_AUX_PP_COUNTER() __COUNTER__ +# else +# define BOOST_MPL_AUX_PP_COUNTER() __LINE__ +# endif +#endif + +#endif // BOOST_MPL_AUX_CONFIG_PP_COUNTER_HPP_INCLUDED diff --git a/include/boost/mpl/aux_/config/ttp.hpp b/include/boost/mpl/aux_/config/ttp.hpp index 88c38d6..c614738 100644 --- a/include/boost/mpl/aux_/config/ttp.hpp +++ b/include/boost/mpl/aux_/config/ttp.hpp @@ -19,7 +19,9 @@ #include #if !defined(BOOST_MPL_CFG_NO_TEMPLATE_TEMPLATE_PARAMETERS) \ - && defined(BOOST_NO_TEMPLATE_TEMPLATES) + && ( defined(BOOST_NO_TEMPLATE_TEMPLATES) \ + || BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT( 0x590) ) \ + ) # define BOOST_MPL_CFG_NO_TEMPLATE_TEMPLATE_PARAMETERS diff --git a/include/boost/mpl/aux_/integral_wrapper.hpp b/include/boost/mpl/aux_/integral_wrapper.hpp index dc2cfc8..af7bb94 100644 --- a/include/boost/mpl/aux_/integral_wrapper.hpp +++ b/include/boost/mpl/aux_/integral_wrapper.hpp @@ -65,7 +65,7 @@ struct AUX_WRAPPER_NAME typedef AUX_WRAPPER_INST(prior_value) prior; #elif BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x561)) \ || BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(502)) \ - || BOOST_WORKAROUND(__HP_aCC, <= 53800) + || (BOOST_WORKAROUND(__HP_aCC, <= 53800) && (BOOST_WORKAROUND(__hpxstd98, != 1))) typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (N + 1)) ) next; typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (N - 1)) ) prior; #else diff --git a/include/boost/mpl/has_xxx.hpp b/include/boost/mpl/has_xxx.hpp index a2f9e7c..9166cc3 100644 --- a/include/boost/mpl/has_xxx.hpp +++ b/include/boost/mpl/has_xxx.hpp @@ -26,6 +26,10 @@ #include +#if BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT(0x590) ) +# include +#endif + #if !defined(BOOST_MPL_CFG_NO_HAS_XXX) # if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) @@ -182,6 +186,41 @@ struct trait \ }; \ /**/ +# elif BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT(0x590) ) + +# define BOOST_MPL_HAS_XXX_TRAIT_NAMED_BCB_DEF(trait, trait_tester, name, default_) \ +template< typename T, bool IS_CLASS > \ +struct trait_tester \ +{ \ + BOOST_STATIC_CONSTANT( bool, value = false ); \ +}; \ +template< typename T > \ +struct trait_tester< T, true > \ +{ \ + struct trait_tester_impl \ + { \ + template < class U > \ + static int resolve( boost::mpl::aux::type_wrapper const volatile * \ + , boost::mpl::aux::type_wrapper* = 0 ); \ + static char resolve( ... ); \ + }; \ + typedef boost::mpl::aux::type_wrapper t_; \ + BOOST_STATIC_CONSTANT( bool, value = ( sizeof( trait_tester_impl::resolve( static_cast< t_ * >(0) ) ) == sizeof(int) ) ); \ +}; \ +template< typename T, typename fallback_ = boost::mpl::bool_ > \ +struct trait \ +{ \ + BOOST_STATIC_CONSTANT( bool, value = (trait_tester< T, boost::is_class< T >::value >::value) ); \ + typedef boost::mpl::bool_< trait< T, fallback_ >::value > type; \ +}; + +# define BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(trait, name, default_) \ + BOOST_MPL_HAS_XXX_TRAIT_NAMED_BCB_DEF( trait \ + , BOOST_PP_CAT(trait,_tester) \ + , name \ + , default_ ) \ +/**/ + # else // other SFINAE-capable compilers # define BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(trait, name, default_) \ diff --git a/include/boost/mpl/or.hpp b/include/boost/mpl/or.hpp index 559ca6b..750730a 100644 --- a/include/boost/mpl/or.hpp +++ b/include/boost/mpl/or.hpp @@ -30,21 +30,25 @@ // has to be checked in a separate condition, otherwise GCC complains // about 'or' being an alternative token #if defined(_MSC_VER) +#ifndef __GCCXML__ #if defined(or) # pragma push_macro("or") # undef or # define or(x) #endif #endif +#endif # define BOOST_MPL_PREPROCESSED_HEADER or.hpp # include #if defined(_MSC_VER) +#ifndef __GCCXML__ #if defined(or) # pragma pop_macro("or") #endif #endif +#endif #else diff --git a/include/boost/mpl/set/aux_/begin_end_impl.hpp b/include/boost/mpl/set/aux_/begin_end_impl.hpp index 22a21b3..5687af6 100644 --- a/include/boost/mpl/set/aux_/begin_end_impl.hpp +++ b/include/boost/mpl/set/aux_/begin_end_impl.hpp @@ -2,7 +2,7 @@ #ifndef BOOST_MPL_SET_AUX_BEGIN_END_IMPL_HPP_INCLUDED #define BOOST_MPL_SET_AUX_BEGIN_END_IMPL_HPP_INCLUDED -// Copyright Aleksey Gurtovoy 2003-2004 +// Copyright Aleksey Gurtovoy 2003-2007 // Copyright David Abrahams 2003-2004 // // Distributed under the Boost Software License, Version 1.0. @@ -24,8 +24,8 @@ template<> struct begin_impl< aux::set_tag > { template< typename Set > struct apply + : s_iter_get { - typedef s_iter type; }; }; diff --git a/include/boost/mpl/set/aux_/erase_key_impl.hpp b/include/boost/mpl/set/aux_/erase_key_impl.hpp index 128c17d..143e5d2 100644 --- a/include/boost/mpl/set/aux_/erase_key_impl.hpp +++ b/include/boost/mpl/set/aux_/erase_key_impl.hpp @@ -2,7 +2,7 @@ #ifndef BOOST_MPL_SET_AUX_ERASE_KEY_IMPL_HPP_INCLUDED #define BOOST_MPL_SET_AUX_ERASE_KEY_IMPL_HPP_INCLUDED -// Copyright Aleksey Gurtovoy 2003-2004 +// Copyright Aleksey Gurtovoy 2003-2007 // Copyright David Abrahams 2003-2004 // // Distributed under the Boost Software License, Version 1.0. @@ -40,7 +40,7 @@ struct erase_key_impl< aux::set_tag > , eval_if< is_same< T,typename Set::item_type_ > , base - , identity< s_mask > + , identity< s_mask > > , identity > diff --git a/include/boost/mpl/set/aux_/insert_impl.hpp b/include/boost/mpl/set/aux_/insert_impl.hpp index ef3df29..884f6f4 100644 --- a/include/boost/mpl/set/aux_/insert_impl.hpp +++ b/include/boost/mpl/set/aux_/insert_impl.hpp @@ -2,7 +2,7 @@ #ifndef BOOST_MPL_SET_AUX_INSERT_IMPL_HPP_INCLUDED #define BOOST_MPL_SET_AUX_INSERT_IMPL_HPP_INCLUDED -// Copyright Aleksey Gurtovoy 2003-2004 +// Copyright Aleksey Gurtovoy 2003-2007 // Copyright David Abrahams 2003-2004 // // Distributed under the Boost Software License, Version 1.0. @@ -36,7 +36,7 @@ template< typename Set, typename T > struct set_insert_impl , eval_if< is_same< T,typename Set::last_masked_ > , base - , identity< s_item > + , identity< s_item > > > { diff --git a/include/boost/mpl/set/aux_/item.hpp b/include/boost/mpl/set/aux_/item.hpp index af3d5c1..1e07976 100644 --- a/include/boost/mpl/set/aux_/item.hpp +++ b/include/boost/mpl/set/aux_/item.hpp @@ -2,7 +2,7 @@ #ifndef BOOST_MPL_SET_AUX_ITEM_HPP_INCLUDED #define BOOST_MPL_SET_AUX_ITEM_HPP_INCLUDED -// Copyright Aleksey Gurtovoy 2003-2004 +// Copyright Aleksey Gurtovoy 2003-2007 // Copyright David Abrahams 2003-2004 // // Distributed under the Boost Software License, Version 1.0. @@ -31,9 +31,7 @@ struct s_item { typedef s_item item_; typedef void_ last_masked_; - typedef Base next_; typedef T item_type_; - typedef item_type_ type; typedef Base base; typedef typename next< typename Base::size >::type size; diff --git a/include/boost/mpl/set/aux_/iterator.hpp b/include/boost/mpl/set/aux_/iterator.hpp index 4814e09..a5499a9 100644 --- a/include/boost/mpl/set/aux_/iterator.hpp +++ b/include/boost/mpl/set/aux_/iterator.hpp @@ -2,7 +2,7 @@ #ifndef BOOST_MPL_SET_AUX_ITERATOR_HPP_INCLUDED #define BOOST_MPL_SET_AUX_ITERATOR_HPP_INCLUDED -// Copyright Aleksey Gurtovoy 2003-2004 +// Copyright Aleksey Gurtovoy 2003-2007 // Copyright David Abrahams 2003-2004 // // Distributed under the Boost Software License, Version 1.0. @@ -26,21 +26,26 @@ namespace boost { namespace mpl { -// used by 's_iter_impl' +// used by 's_iter_get' template< typename Set, typename Tail > struct s_iter; +template< typename Set, typename Tail > struct s_iter_get + : eval_if< + has_key< Set,typename Tail::item_type_ > + , identity< s_iter > + , next< s_iter > + > +{ +}; + template< typename Set, typename Tail > struct s_iter_impl { typedef Tail tail_; typedef forward_iterator_tag category; - typedef typename Tail::item_::type type; + typedef typename Tail::item_type_ type; #if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) - typedef typename eval_if< - has_key< Set,typename Tail::next_::type > - , identity< s_iter > - , next< s_iter > - >::type next; + typedef typename s_iter_get< Set,typename Tail::base >::type next; #endif }; @@ -48,11 +53,7 @@ template< typename Set, typename Tail > struct s_iter_impl template< typename Set, typename Tail > struct next< s_iter > - : eval_if< - has_key< Set,typename Tail::next_::type > - , identity< s_iter > - , next< s_iter > - > + : s_iter_get< Set,typename Tail::base > { }; diff --git a/include/boost/mpl/set/aux_/set0.hpp b/include/boost/mpl/set/aux_/set0.hpp index 44473ba..5f38d7f 100644 --- a/include/boost/mpl/set/aux_/set0.hpp +++ b/include/boost/mpl/set/aux_/set0.hpp @@ -53,10 +53,10 @@ namespace boost { namespace mpl { template< typename Dummy = na > struct set0 { typedef set0<> item_; + typedef item_ type; typedef aux::set_tag tag; typedef void_ last_masked_; typedef void_ item_type_; - typedef item_type_ type; typedef long_<0> size; typedef long_<1> order;