Boost logo

Boost-Commit :

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


Author: bbartman
Date: 2010-06-17 15:12:14 EDT (Thu, 17 Jun 2010)
New Revision: 63056
URL: http://svn.boost.org/trac/boost/changeset/63056

Log:
at_key is implemented in terms of my iterator class
Text files modified:
   sandbox/SOC/2010/bit_masks/boost/integer/bitfield_tuple.hpp | 22 ----------------------
   sandbox/SOC/2010/bit_masks/boost/integer/details/bft/ext/bitfield_iterator.hpp | 4 ++--
   sandbox/SOC/2010/bit_masks/boost/integer/details/bft/ext/fusion/at_key_impl.hpp | 38 --------------------------------------
   sandbox/SOC/2010/bit_masks/lib/integer/test/bft_testing/fusion_integration_testing.cpp | 7 ++++++-
   4 files changed, 8 insertions(+), 63 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-17 15:12:14 EDT (Thu, 17 Jun 2010)
@@ -234,28 +234,6 @@
     std::string to_string() const;
     //@}
 
- template <typename Name>
- struct name_exists {
- typedef typename mpl::not_<
- is_same <
- typename ::boost::mpl::find_if<
- members,
- ::boost::details::match_name<
- ::boost::mpl::_1,
- Name
- >
- >::type,
- typename mpl::end<
- members
- >::type
- >
- >::type type;
- };
-
- template <typename Key>
- struct find_key {
-
- };
 
     /** Get function interfaces.
      * These provide access into the tuple via "reference".

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-17 15:12:14 EDT (Thu, 17 Jun 2010)
@@ -165,8 +165,8 @@
 
     /** Fusion extension: advance. */
     template <typename Iterator, typename N>
- struct advance :
- mpl::if_c<
+ struct advance
+ : mpl::if_c<
             (N::value > 0),
             fusion::advance_detail::forward<Iterator, N::value>,
             fusion::advance_detail::backward<Iterator, N::value>

Modified: sandbox/SOC/2010/bit_masks/boost/integer/details/bft/ext/fusion/at_key_impl.hpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/boost/integer/details/bft/ext/fusion/at_key_impl.hpp (original)
+++ sandbox/SOC/2010/bit_masks/boost/integer/details/bft/ext/fusion/at_key_impl.hpp 2010-06-17 15:12:14 EDT (Thu, 17 Jun 2010)
@@ -3,41 +3,3 @@
 // (See accompanying file LICENSE_1_0.txt or copy at
 // http://www.boost.org/LICENSE_1_0.txt)
 
-#ifndef BOOST_BITFIELD_TUPLE_FUSION_EXT_AT_IMPL_HPP
-#define BOOST_BITFIELD_TUPLE_FUSION_EXT_AT_IMPL_HPP
-
-
-namespace boost {
-
-struct bitfield_tuple_tag;
-
-namespace fusion { namespace extension {
-
-
-template <typename> struct at_key_impl;
-
-template <>
-struct at_key_impl< bitfield_tuple_tag > {
-
- template <typename BitfieldTuple, typename Name>
- struct apply {
- typedef typename BitfieldTuple::
- template name_exists<
- Name
- >::type
- found_name;
- STATIC_ASSERT(( found_name::value ));
-
-
- //static type call(BitfieldTuple& bft) {
- // return type( bft.data() );
- //}
- };
-};
-
-}}} // end boost::fusion::extension
-
-
-
-
-#endif

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-17 15:12:14 EDT (Thu, 17 Jun 2010)
@@ -87,7 +87,12 @@
     {
         test_tuple temp;
         temp.get<salmon>() = 3;
- BOOST_ASSERT(( fusion::at_key<salmon>( temp ) == 3));
+
+ BOOST_ASSERT(( fusion::at_key<salmon>( temp ) == 3));
+ fusion::at_key<salmon>(temp) = 4;
+ BOOST_ASSERT(( fusion::at_key<salmon>( temp ) == 4));
+ BOOST_ASSERT(( temp.get<salmon>() == 4));
+ BOOST_ASSERT(( fusion::at_key<green>( temp ) == 0));
     }
     /*
     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