'set' fixes + more thorough regression tests

[SVN r37335]
This commit is contained in:
Aleksey Gurtovoy
2007-04-02 07:42:41 +00:00
parent 6d0ea17411
commit b4048c1b75
7 changed files with 245 additions and 105 deletions
@@ -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<Set,typename Set::item_>
{
typedef s_iter<Set,Set> type;
};
};
@@ -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<Set>
, identity< s_mask<T,Set> >
, identity< s_mask<T,typename Set::item_> >
>
, identity<Set>
>
+2 -2
View File
@@ -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<Set>
, identity< s_item<T,Set> >
, identity< s_item<T,typename Set::item_> >
>
>
{
+1 -3
View File
@@ -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<T,Base> 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;
+14 -13
View File
@@ -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<Set,Tail> >
, next< s_iter<Set,Tail> >
>
{
};
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<Set,typename Tail::next_> >
, next< s_iter<Set,typename Tail::next_> >
>::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<Set,Tail> >
: eval_if<
has_key< Set,typename Tail::next_::type >
, identity< s_iter<Set,typename Tail::next_> >
, next< s_iter<Set,typename Tail::next_> >
>
: s_iter_get< Set,typename Tail::base >
{
};
+1 -1
View File
@@ -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;