|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r62489 - in sandbox/SOC/2010/bit_masks: boost/integer boost/integer/details boost/integer/details/bit_mask_group_fusion_ext boost/integer/details/bit_mask_group_fusion_ext/details lib/integer/test
From: bbartmanboost_at_[hidden]
Date: 2010-06-06 15:33:27
Author: bbartman
Date: 2010-06-06 15:33:25 EDT (Sun, 06 Jun 2010)
New Revision: 62489
URL: http://svn.boost.org/trac/boost/changeset/62489
Log:
working on debugging a fusion sequence
Text files modified:
sandbox/SOC/2010/bit_masks/boost/integer/bit_mask_group.hpp | 2 +
sandbox/SOC/2010/bit_masks/boost/integer/details/bit_mask_group_fusion_ext/bit_mask_group_iterator.hpp | 5 ++-
sandbox/SOC/2010/bit_masks/boost/integer/details/bit_mask_group_fusion_ext/details/begin_impl.hpp | 24 +++++++++++------
sandbox/SOC/2010/bit_masks/boost/integer/details/bit_mask_group_fusion_ext/details/is_sequence_impl.hpp | 19 ++++++++++----
sandbox/SOC/2010/bit_masks/boost/integer/details/bit_mask_group_fusion_ext/details/is_view_impl.hpp | 21 +++++++++++----
sandbox/SOC/2010/bit_masks/boost/integer/details/bit_mask_group_fusion_ext/details/tag_and_fusion_fwd.hpp | 4 +-
sandbox/SOC/2010/bit_masks/boost/integer/details/bit_mask_group_fusion_ext/fusion_includes.hpp | 10 +++---
sandbox/SOC/2010/bit_masks/boost/integer/details/bit_mask_group_fusion_ext/tag_of.hpp | 46 ++++++++++++++++++++--------------
sandbox/SOC/2010/bit_masks/boost/integer/details/bit_mask_group_impl.hpp | 6 ++--
sandbox/SOC/2010/bit_masks/lib/integer/test/bit_mask_group_test.cpp | 52 +++++++++++++++++++++++++++++++++++++++
10 files changed, 136 insertions(+), 53 deletions(-)
Modified: sandbox/SOC/2010/bit_masks/boost/integer/bit_mask_group.hpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/boost/integer/bit_mask_group.hpp (original)
+++ sandbox/SOC/2010/bit_masks/boost/integer/bit_mask_group.hpp 2010-06-06 15:33:25 EDT (Sun, 06 Jun 2010)
@@ -123,4 +123,6 @@
} // end boost
+#include <boost/integer/details/bit_mask_group_fusion_ext/fusion_includes.hpp>
+
#endif
Modified: sandbox/SOC/2010/bit_masks/boost/integer/details/bit_mask_group_fusion_ext/bit_mask_group_iterator.hpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/boost/integer/details/bit_mask_group_fusion_ext/bit_mask_group_iterator.hpp (original)
+++ sandbox/SOC/2010/bit_masks/boost/integer/details/bit_mask_group_fusion_ext/bit_mask_group_iterator.hpp 2010-06-06 15:33:25 EDT (Sun, 06 Jun 2010)
@@ -16,7 +16,7 @@
#include <boost/type_traits/is_const.hpp>
#include <boost/fusion/iterator/iterator_facade.hpp>
-namespace boost {
+namespace boost { namespace fusion {
/** This is the iterator which holds the maskgroup and allows
* the user to iterate over a bit_mask_group type.
@@ -91,10 +91,11 @@
static type call(I1 const&, I2 const&) {
return type();
}
+
};
};
-} // end boost
+} } // end boost::fusion
#endif
Modified: sandbox/SOC/2010/bit_masks/boost/integer/details/bit_mask_group_fusion_ext/details/begin_impl.hpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/boost/integer/details/bit_mask_group_fusion_ext/details/begin_impl.hpp (original)
+++ sandbox/SOC/2010/bit_masks/boost/integer/details/bit_mask_group_fusion_ext/details/begin_impl.hpp 2010-06-06 15:33:25 EDT (Sun, 06 Jun 2010)
@@ -6,19 +6,25 @@
#ifndef BOOST_BIT_MASK_GROUP_FUSION_EXT_BEGIN_IMPL_HPP
#define BOOST_BIT_MASK_GROUP_FUSION_EXT_BEGIN_IMPL_HPP
-namespace boost { namespace fusion { namespace extension {
+namespace boost { namespace fusion {
-template <>
-struct begin_impl< boost::details::bit_mask_group_tag > {
- template<typename MaskGroup>
- struct apply {
- typedef boost::bit_mask_group_iterator<MaskGroup, 0> type;
+ struct bit_mask_group_tag;
+
+ namespace extension {
+
+ template<typename> struct begin_impl;
+
+ template <>
+ struct begin_impl< bit_mask_group_tag > {
+ template<typename MaskGroup>
+ struct apply {
+ typedef bit_mask_group_iterator<MaskGroup, 0> type;
- static type call(MaskGroup&) {
+ static type call(MaskGroup&) {
return type();
- }
+ }
+ };
};
-};
}}} // end boost::fusion::extension
Modified: sandbox/SOC/2010/bit_masks/boost/integer/details/bit_mask_group_fusion_ext/details/is_sequence_impl.hpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/boost/integer/details/bit_mask_group_fusion_ext/details/is_sequence_impl.hpp (original)
+++ sandbox/SOC/2010/bit_masks/boost/integer/details/bit_mask_group_fusion_ext/details/is_sequence_impl.hpp 2010-06-06 15:33:25 EDT (Sun, 06 Jun 2010)
@@ -6,13 +6,20 @@
#ifndef BOOST_BIT_MASK_GROUP_FUSION_EXT_IS_SEQUENCE_IMPL_HPP
#define BOOST_BIT_MASK_GROUP_FUSION_EXT_IS_SEQUENCE_IMPL_HPP
-namespace boost { namespace fusion { namespace extension {
+namespace boost { namespace fusion {
-template<>
-struct is_sequence_impl< boost::details::bit_mask_group_tag > {
- template<typename T>
- struct apply : mpl::true_ { };
-};
+ struct bit_mask_group_tag;
+
+ namespace extension {
+
+ template <typename>
+ struct is_sequence_impl;
+
+ template<>
+ struct is_sequence_impl< bit_mask_group_tag > {
+ template<typename T>
+ struct apply : mpl::true_ { };
+ };
}}} // end boost::fusion::extension
Modified: sandbox/SOC/2010/bit_masks/boost/integer/details/bit_mask_group_fusion_ext/details/is_view_impl.hpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/boost/integer/details/bit_mask_group_fusion_ext/details/is_view_impl.hpp (original)
+++ sandbox/SOC/2010/bit_masks/boost/integer/details/bit_mask_group_fusion_ext/details/is_view_impl.hpp 2010-06-06 15:33:25 EDT (Sun, 06 Jun 2010)
@@ -6,13 +6,22 @@
#ifndef BOOST_BIT_MASK_GROUP_FUSION_EXT_IS_VIEW_IMPL_HPP
#define BOOST_BIT_MASK_GROUP_FUSION_EXT_IS_VIEW_IMPL_HPP
-namespace boost { namespace fusion { namespace extension {
+#include <boost/mpl/bool.hpp>
-template <>
-struct is_view_impl< boost::details::bit_mask_group_tag > {
- template <typename Sequence>
- struct apply : mpl::false_ { };
-};
+namespace boost { namespace fusion {
+
+ struct bit_mask_group;
+
+ namespace extension {
+
+ template<typename Tag>
+ struct is_view_impl;
+
+ template <>
+ struct is_view_impl< bit_mask_group_tag > {
+ template <typename>
+ struct apply : mpl::false_ { };
+ };
}}} // end boost::fusion::extension
Modified: sandbox/SOC/2010/bit_masks/boost/integer/details/bit_mask_group_fusion_ext/details/tag_and_fusion_fwd.hpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/boost/integer/details/bit_mask_group_fusion_ext/details/tag_and_fusion_fwd.hpp (original)
+++ sandbox/SOC/2010/bit_masks/boost/integer/details/bit_mask_group_fusion_ext/details/tag_and_fusion_fwd.hpp 2010-06-06 15:33:25 EDT (Sun, 06 Jun 2010)
@@ -16,10 +16,10 @@
/** bit_mask_group's Sequence tag.
* Used for dispatching to overloads.
*/
-struct bit_mask_group_tag;
+struct bit_mask_group_tag { };
/** bit_mask_group's iterator tag. */
-struct bit_mask_group_iterator_tag;
+struct bit_mask_group_iterator_tag { };
} // end details
Modified: sandbox/SOC/2010/bit_masks/boost/integer/details/bit_mask_group_fusion_ext/fusion_includes.hpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/boost/integer/details/bit_mask_group_fusion_ext/fusion_includes.hpp (original)
+++ sandbox/SOC/2010/bit_masks/boost/integer/details/bit_mask_group_fusion_ext/fusion_includes.hpp 2010-06-06 15:33:25 EDT (Sun, 06 Jun 2010)
@@ -25,14 +25,14 @@
#include "details/tag_and_fusion_fwd.hpp"
#include "bit_mask_group_iterator.hpp"
#include "tag_of.hpp"
-#include "details/category_of_impl.hpp"
+// #include "details/category_of_impl.hpp"
#include "details/is_sequence_impl.hpp"
#include "details/is_view_impl.hpp"
-#include "details/end_impl.hpp"
+// #include "details/end_impl.hpp"
#include "details/begin_impl.hpp"
-#include "details/size_impl.hpp"
-#include "details/value_at_impl.hpp"
-#include "details/at_impl.hpp"
+// #include "details/size_impl.hpp"
+// #include "details/value_at_impl.hpp"
+// #include "details/at_impl.hpp"
#endif
Modified: sandbox/SOC/2010/bit_masks/boost/integer/details/bit_mask_group_fusion_ext/tag_of.hpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/boost/integer/details/bit_mask_group_fusion_ext/tag_of.hpp (original)
+++ sandbox/SOC/2010/bit_masks/boost/integer/details/bit_mask_group_fusion_ext/tag_of.hpp 2010-06-06 15:33:25 EDT (Sun, 06 Jun 2010)
@@ -3,29 +3,37 @@
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
+
#ifndef BOOST_BIT_MASK_GROUP_TAG_OF_HPP
#define BOOST_BIT_MASK_GROUP_TAG_OF_HPP
-namespace boost { namespace fusion { namespace traits {
+#include <boost/fusion/support/tag_of_fwd.hpp>
+#include <cstddef>
+
+namespace boost { namespace fusion {
-/** bit_mask_group specilization. */
-template<>
-template < typename Mask0, typename Mask1, typename Mask2, typename Mask3,
- typename Mask4, typename Mask5, typename Mask6, typename Mask7,
- typename Mask8,typename Mask9 >
-struct tag_of< boost::bit_mask_group<Mask0, Mask1, Mask2, Mask3, Mask4,
- Mask5, Mask6, Mask7, Mask8, Mask9 > >
-{
- typedef boost::details::bit_mask_group_tag type;
-};
-
-
-/** Iterator tag_of specilization. */
-template<>
-template <typename MaskGroup, unsigned int Pos>
-struct tag_of< boost::bit_mask_group_iterator<MaskGroup,Pos> > {
- typedef boost::details::bit_mask_group_iterator_tag type;
-};
+ struct bit_mask_group_tag;
+ struct bit_mask_group_iterator_tag;
+
+ namespace traits {
+
+ /** bit_mask_group specilization. */
+ template < typename Mask0, typename Mask1, typename Mask2, typename Mask3,
+ typename Mask4, typename Mask5, typename Mask6, typename Mask7,
+ typename Mask8, typename Mask9 >
+ struct tag_of< boost::bit_mask_group< Mask0, Mask1, Mask2, Mask3, Mask4,
+ Mask5, Mask6, Mask7, Mask8, Mask9 > >
+ {
+ typedef bit_mask_group_tag type;
+ };
+
+
+ /** Iterator tag_of specilization. */
+ template <typename Extra>
+ template <typename MaskGroup, std::size_t Pos>
+ struct tag_of< boost::fusion::bit_mask_group_iterator< MaskGroup, Pos >, Extra> {
+ typedef bit_mask_group_iterator_tag type;
+ };
}}} // end boost::fusion::traits
Modified: sandbox/SOC/2010/bit_masks/boost/integer/details/bit_mask_group_impl.hpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/boost/integer/details/bit_mask_group_impl.hpp (original)
+++ sandbox/SOC/2010/bit_masks/boost/integer/details/bit_mask_group_impl.hpp 2010-06-06 15:33:25 EDT (Sun, 06 Jun 2010)
@@ -18,7 +18,7 @@
#include <boost/mpl/push_back.hpp>
#include <boost/mpl/at.hpp>
#include <boost/mpl/void.hpp>
-#include <boost/integer/details/bit_mask_group_fusion_ext/fusion_includes.hpp>
+
@@ -94,7 +94,7 @@
};
} } // end details
-
+#if 0
namespace boost { namespace fusion { namespace extension {
//TODO: May not need the impl overloads for the iterator because its gets
@@ -247,7 +247,7 @@
}}} // end boost::fusion::extention
-
+#endif
#endif
Modified: sandbox/SOC/2010/bit_masks/lib/integer/test/bit_mask_group_test.cpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/lib/integer/test/bit_mask_group_test.cpp (original)
+++ sandbox/SOC/2010/bit_masks/lib/integer/test/bit_mask_group_test.cpp 2010-06-06 15:33:25 EDT (Sun, 06 Jun 2010)
@@ -6,8 +6,17 @@
#include <boost/integer/bit_mask_group.hpp>
#include "test_type_list.hpp"
+#include <boost/fusion/sequence/intrinsic.hpp>
+#include <boost/fusion/support/is_sequence.hpp>
+#include <boost/fusion/support/is_view.hpp>
+#include <boost/fusion/iterator.hpp>
+
+#include <boost/mpl/assert.hpp>
+
struct name_tag { };
+struct name_tag_2 { };
+
int main() {
typedef bit_mask_group<
tagged<
@@ -35,7 +44,48 @@
low_bits_mask<int,9>
>::value
));
-
+ {
+
+ using namespace boost::fusion;
+ typedef boost::bit_mask_group<
+ // tagged< low_bits_mask< int, 9 >, name_tag >,
+ // bits_mask< int, 9 >,
+ // bits_mask<int, 8 >,
+ // high_bits_mask< int, 3 >,
+ integral_mask< int, 0xdeadbeef > //,
+ // tagged< integral_mask< unsigned int, 0xdeadbabe >, name_tag_2 >
+ > bmg_t;
+
+ // make sure that this is a sequence and is not a view.
+ BOOST_ASSERT(( traits::is_sequence<bmg_t>::value ));
+ BOOST_ASSERT(( ! traits::is_view<bmg_t>::value ));
+
+ // create an instance of this type and then test the rest
+ // of the functions which are implemented on this type to make sure they
+ // work.
+ bmg_t bmg;
+
+ BOOST_ASSERT(( (*begin(bmg)) == bmg.get<0>() ));
+ // BOOST_ASSERT(( ));
+ // BOOST_ASSERT(( ));
+ // BOOST_ASSERT(( ));
+ // BOOST_ASSERT(( ));
+#if 0
+
+
+ BOOST_TEST(*begin(arr) == 1);
+ BOOST_TEST(*next(begin(arr)) == 2);
+ BOOST_TEST(*advance_c<2>(begin(arr)) == 3);
+ BOOST_TEST(prior(next(begin(arr))) == begin(arr));
+ BOOST_TEST(*prior(end(arr)) == 3);
+ BOOST_TEST(at_c<2>(arr) == 3);
+ BOOST_TEST(size(arr) == 3);
+ BOOST_TEST(distance(begin(arr), end(arr)) == 3);
+
+ return boost::report_errors();
+}
+#endif
+ }
return 0;
}
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