Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r65166 - in trunk: boost/mpl/set/aux_ libs/mpl/test
From: steven_at_[hidden]
Date: 2010-09-01 11:16:55


Author: steven_watanabe
Date: 2010-09-01 11:16:53 EDT (Wed, 01 Sep 2010)
New Revision: 65166
URL: http://svn.boost.org/trac/boost/changeset/65166

Log:
Fix set_c iterators.
Text files modified:
   trunk/boost/mpl/set/aux_/item.hpp | 6 +++---
   trunk/libs/mpl/test/set_c.cpp | 21 +++++++++++++++++++++
   2 files changed, 24 insertions(+), 3 deletions(-)

Modified: trunk/boost/mpl/set/aux_/item.hpp
==============================================================================
--- trunk/boost/mpl/set/aux_/item.hpp (original)
+++ trunk/boost/mpl/set/aux_/item.hpp 2010-09-01 11:16:53 EDT (Wed, 01 Sep 2010)
@@ -32,7 +32,7 @@
     typedef s_item<T,Base> item_;
     typedef void_ last_masked_;
     typedef T item_type_;
- typedef Base base;
+ typedef typename Base::item_ base;
     
     typedef typename next< typename Base::size >::type size;
     typedef typename next< typename Base::order >::type order;
@@ -55,7 +55,7 @@
     typedef s_mask<T,Base> item_;
     typedef T last_masked_;
     typedef void_ item_type_;
- typedef Base base;
+ typedef typename Base::item_ base;
     typedef typename prior< typename Base::size >::type size;
 
     BOOST_MPL_AUX_SET_OVERLOAD( aux::yes_tag, IS_MASKED, s_mask, aux::type_wrapper<T>* );
@@ -69,7 +69,7 @@
     typedef s_unmask<T,Base> item_;
     typedef void_ last_masked_;
     typedef T item_type_;
- typedef Base base;
+ typedef typename Base::item_ base;
     typedef typename next< typename Base::size >::type size;
 
     BOOST_MPL_AUX_SET_OVERLOAD( aux::no_tag, IS_MASKED, s_unmask, aux::type_wrapper<T>* );

Modified: trunk/libs/mpl/test/set_c.cpp
==============================================================================
--- trunk/libs/mpl/test/set_c.cpp (original)
+++ trunk/libs/mpl/test/set_c.cpp 2010-09-01 11:16:53 EDT (Wed, 01 Sep 2010)
@@ -14,6 +14,7 @@
 #include <boost/mpl/set_c.hpp>
 #include <boost/mpl/at.hpp>
 #include <boost/mpl/size.hpp>
+#include <boost/mpl/begin_end.hpp>
 
 #include <boost/mpl/aux_/test.hpp>
 
@@ -59,6 +60,18 @@
     MPL_ASSERT(( is_same< test::at_c<s1,false>::type, void_ > ));
     MPL_ASSERT(( is_same< test::at_c<s2,true>::type, void_ > ));
 #endif
+
+ typedef begin<s1>::type first1;
+ typedef end<s1>::type last1;
+ MPL_ASSERT_RELATION( (distance<first1, last1>::value), ==, 1 );
+
+ typedef begin<s2>::type first2;
+ typedef end<s2>::type last2;
+ MPL_ASSERT_RELATION( (distance<first2, last2>::value), ==, 1 );
+
+ typedef begin<s3>::type first3;
+ typedef end<s3>::type last3;
+ MPL_ASSERT_RELATION( (distance<first3, last3>::value), ==, 2 );
 }
 #endif
 
@@ -82,4 +95,12 @@
     MPL_ASSERT(( is_same< test::at_c<s1,'z'>::type, void_ > ));
     MPL_ASSERT(( is_same< test::at_c<s2,'k'>::type, void_ > ));
 #endif
+
+ typedef begin<s1>::type first1;
+ typedef end<s1>::type last1;
+ MPL_ASSERT_RELATION( (distance<first1, last1>::value), ==, 1 );
+
+ typedef begin<s2>::type first2;
+ typedef end<s2>::type last2;
+ MPL_ASSERT_RELATION( (distance<first2, last2>::value), ==, 8 );
 }


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk