Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r62993 - in sandbox/SOC/2010/bit_masks: boost/integer boost/integer/details/bft/ext lib/integer/test/bft_testing
From: bbartmanboost_at_[hidden]
Date: 2010-06-15 15:38:04


Author: bbartman
Date: 2010-06-15 15:38:00 EDT (Tue, 15 Jun 2010)
New Revision: 62993
URL: http://svn.boost.org/trac/boost/changeset/62993

Log:
working on deref for fusion extension
Text files modified:
   sandbox/SOC/2010/bit_masks/boost/integer/bitfield_tuple.hpp | 4 ++--
   sandbox/SOC/2010/bit_masks/boost/integer/details/bft/ext/bitfield_iterator.hpp | 13 +++++++++----
   sandbox/SOC/2010/bit_masks/lib/integer/test/bft_testing/fusion_integration_testing.cpp | 15 ++++++---------
   3 files changed, 17 insertions(+), 15 deletions(-)

Modified: sandbox/SOC/2010/bit_masks/boost/integer/bitfield_tuple.hpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/boost/integer/bitfield_tuple.hpp (original)
+++ sandbox/SOC/2010/bit_masks/boost/integer/bitfield_tuple.hpp 2010-06-15 15:38:00 EDT (Tue, 15 Jun 2010)
@@ -220,11 +220,11 @@
      * Retuns a copy of the internally stored type.
      */
     //@{
- storage_type const data( ) const {
+ storage_type const& data( ) const {
          return _data;
     }
 
- storage_type data( ) {
+ storage_type& data( ) {
          return _data;
     }
     //@}

Modified: sandbox/SOC/2010/bit_masks/boost/integer/details/bft/ext/bitfield_iterator.hpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/boost/integer/details/bft/ext/bitfield_iterator.hpp (original)
+++ sandbox/SOC/2010/bit_masks/boost/integer/details/bft/ext/bitfield_iterator.hpp 2010-06-15 15:38:00 EDT (Tue, 15 Jun 2010)
@@ -45,6 +45,9 @@
     bitfield_tuple_iterator(BitfieldTuple& bft)
         : _data(bft) { }
 
+
+ BitfieldTuple& _data;
+
     /** Important information about the current iterators
      * template parameters.
      */
@@ -69,9 +72,12 @@
     template <typename Iter>
     struct deref {
         // the type returned by dereferencing the iterator.
- typedef typename details::IMPLEMENT_ME type;
+ typedef typename value_of<Iter>::type type;
+
         // dereference operation.
- static type call(Iter& iter);
+ static type call(Iter& iter) {
+ return type( iter._data.data() );
+ }
     };
 
     template<typename Iter>
@@ -110,8 +116,7 @@
         static type call(Iter& it);
     };
 
-private:
- BitfieldTuple& _data;
+
 };
 
 } // end boost::fusion

Modified: sandbox/SOC/2010/bit_masks/lib/integer/test/bft_testing/fusion_integration_testing.cpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/lib/integer/test/bft_testing/fusion_integration_testing.cpp (original)
+++ sandbox/SOC/2010/bit_masks/lib/integer/test/bft_testing/fusion_integration_testing.cpp 2010-06-15 15:38:00 EDT (Tue, 15 Jun 2010)
@@ -31,22 +31,19 @@
         typedef fusion::traits::tag_of<test_tuple>::type tag;
         BOOST_MPL_ASSERT(( is_same< tag, fusion::bitfield_tuple_tag> ));
     }
- // iterator tag_of testing. still don't know if this is really needed
- // for fusion integration, at any rate I can't seem to get it to work.
- {
- // typedef bitfield_tuple_iterator<test_tuple,0> iter;
- // typedef fusion::traits::tag_of<iter>::type tag;
- // BOOST_MPL_ASSERT(( is_same<bitfield_tuple_iterator_tag, tag> ));
- }
 
- // iterator value of testing.
- // this is strange to tes, because of the construction of the
+ // iterator value_of
+ // this is strange to test, because of the construction of the
     // members vector.
     {
         typedef bitfield_tuple_iterator<test_tuple,0> iter;
         typedef fusion::result_of::value_of<iter>::type value_of_result;
         BOOST_MPL_ASSERT(( is_same< value_of_result::return_type, char> ));
     }
+ // Iterator deref
+ {
+
+ }
     /*
     bmg_t bmg;
 


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