Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r59250 - in sandbox/SOC/2009/fusion: boost/fusion boost/fusion/adapted boost/fusion/adapted/detail/struct boost/fusion/adapted/struct boost/fusion/algorithm/query/ext_ boost/fusion/container/list/detail boost/fusion/container/map/detail boost/fusion/container/set/detail boost/fusion/container/vector/detail/variadic_templates boost/fusion/include boost/fusion/sequence/intrinsic/ext_ boost/fusion/support/ext_ boost/fusion/view/ext_ libs/fusion/test libs/fusion/test/sequence
From: mr.chr.schmidt_at_[hidden]
Date: 2010-01-24 08:35:22


Author: cschmidt
Date: 2010-01-24 08:35:20 EST (Sun, 24 Jan 2010)
New Revision: 59250
URL: http://svn.boost.org/trac/boost/changeset/59250

Log:
added adapt class & friends (1)
Added:
   sandbox/SOC/2009/fusion/boost/fusion/adapted/class.hpp (contents, props changed)
   sandbox/SOC/2009/fusion/boost/fusion/include/adapt_assoc_class.hpp (contents, props changed)
   sandbox/SOC/2009/fusion/boost/fusion/include/adapt_class.hpp (contents, props changed)
   sandbox/SOC/2009/fusion/libs/fusion/test/sequence/adapt_class.cpp (contents, props changed)
Removed:
   sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/struct/adapt_assoc_struct.hpp
   sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/struct/adapt_struct.hpp
   sandbox/SOC/2009/fusion/boost/fusion/view/ext_/multiple_view.hpp
Text files modified:
   sandbox/SOC/2009/fusion/boost/fusion/adapted.hpp | 2
   sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/struct/category_of_impl.hpp | 4
   sandbox/SOC/2009/fusion/boost/fusion/adapted/struct/adapt_assoc_struct.hpp | 30 +++
   sandbox/SOC/2009/fusion/boost/fusion/adapted/struct/adapt_struct.hpp | 20 +
   sandbox/SOC/2009/fusion/boost/fusion/algorithm/query/ext_/find_if_s.hpp | 369 +++++++++++++++++++++------------------
   sandbox/SOC/2009/fusion/boost/fusion/container/list/detail/build_cons.hpp | 3
   sandbox/SOC/2009/fusion/boost/fusion/container/map/detail/deref_data_impl.hpp | 2
   sandbox/SOC/2009/fusion/boost/fusion/container/map/detail/deref_impl.hpp | 2
   sandbox/SOC/2009/fusion/boost/fusion/container/set/detail/deref_impl.hpp | 2
   sandbox/SOC/2009/fusion/boost/fusion/container/vector/detail/variadic_templates/tagged_impl.hpp | 4
   sandbox/SOC/2009/fusion/boost/fusion/container/vector/detail/variadic_templates/vector.hpp | 22 +-
   sandbox/SOC/2009/fusion/boost/fusion/sequence/intrinsic/ext_/segments.hpp | 71 ++++---
   sandbox/SOC/2009/fusion/boost/fusion/sequence/intrinsic/ext_/size_s.hpp | 62 +++--
   sandbox/SOC/2009/fusion/boost/fusion/support/ext_/is_segmented.hpp | 28 --
   sandbox/SOC/2009/fusion/boost/fusion/view/ext_/segmented_iterator.hpp | 103 ++++------
   sandbox/SOC/2009/fusion/boost/fusion/view/ext_/segmented_iterator_range.hpp | 48 ++--
   sandbox/SOC/2009/fusion/libs/fusion/test/Jamfile | 7
   17 files changed, 421 insertions(+), 358 deletions(-)

Modified: sandbox/SOC/2009/fusion/boost/fusion/adapted.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/adapted.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/adapted.hpp 2010-01-24 08:35:20 EST (Sun, 24 Jan 2010)
@@ -1,6 +1,7 @@
 /*=============================================================================
     Copyright (c) 2001-2006 Joel de Guzman
     Copyright (c) 2005-2006 Dan Marsden
+ Copyright (c) 2010 Christopher Schmidt
 
     Distributed under the Boost Software License, Version 1.0. (See accompanying
     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -12,6 +13,7 @@
 #include <boost/fusion/adapted/array.hpp>
 #include <boost/fusion/adapted/boost_array.hpp>
 #include <boost/fusion/adapted/boost_tuple.hpp>
+#include <boost/fusion/adapted/class.hpp>
 #include <boost/fusion/adapted/mpl.hpp>
 #include <boost/fusion/adapted/std_array.hpp>
 #include <boost/fusion/adapted/std_pair.hpp>

Added: sandbox/SOC/2009/fusion/boost/fusion/adapted/class.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/fusion/boost/fusion/adapted/class.hpp 2010-01-24 08:35:20 EST (Sun, 24 Jan 2010)
@@ -0,0 +1,16 @@
+/*=============================================================================
+ Copyright (c) 2001-2006 Joel de Guzman
+ Copyright (c) 2005-2006 Dan Marsden
+ Copyright (c) 2010 Christopher Schmidt
+
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+==============================================================================*/
+
+#ifndef BOOST_FUSION_ADAPTED_CLASS_HPP
+#define BOOST_FUSION_ADAPTED_CLASS_HPP
+
+#include <boost/fusion/adapted/class/adapt_assoc_class.hpp>
+#include <boost/fusion/adapted/class/adapt_class.hpp>
+
+#endif

Deleted: sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/struct/adapt_assoc_struct.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/struct/adapt_assoc_struct.hpp 2010-01-24 08:35:20 EST (Sun, 24 Jan 2010)
+++ (empty file)
@@ -1,42 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2007 Joel de Guzman
- Copyright (c) 2007 Dan Marsden
- Copyright (c) 2009 Christopher Schmidt
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-==============================================================================*/
-
-#ifndef BOOST_FUSION_ADAPTED_DETAIL_STRUCT_ADAPT_ASSOC_STRUCT_HPP
-#define BOOST_FUSION_ADAPTED_DETAIL_STRUCT_ADAPT_ASSOC_STRUCT_HPP
-
-#include <boost/preprocessor/cat.hpp>
-#include <boost/preprocessor/tuple/elem.hpp>
-
-#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0(X, Y, Z)\
- ((X, Y, Z)) BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_1
-#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_1(X, Y, Z)\
- ((X, Y, Z)) BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0
-#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0_END
-#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_1_END
-
-#define BOOST_FUSION_ADAPT_ASSOC_STRUCT(NAME, SEQ)\
- BOOST_FUSION_ADAPT_STRUCT_BASE(\
- NAME,\
- assoc_struct_tag,\
- BOOST_PP_CAT(BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0 SEQ,_END),\
- BOOST_FUSION_ADAPT_ASSOC_STRUCT_C)
-
-#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_C(R, NAME, I, XYZ) \
- BOOST_FUSION_ADAPT_STRUCT_C_BASE(NAME, I, XYZ, 3) \
- \
-namespace boost { namespace fusion { namespace extension \
-{ \
- template<> \
- struct struct_assoc_key<NAME, I> \
- { \
- typedef BOOST_PP_TUPLE_ELEM(3, 2, XYZ) type; \
- }; \
-}}}
-
-#endif

Deleted: sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/struct/adapt_struct.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/struct/adapt_struct.hpp 2010-01-24 08:35:20 EST (Sun, 24 Jan 2010)
+++ (empty file)
@@ -1,31 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2007 Joel de Guzman
- Copyright (c) 2009 Christopher Schmidt
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-==============================================================================*/
-
-#ifndef BOOST_FUSION_ADAPTED_DETAIL_STRUCT_ADAPT_STRUCT_HPP
-#define BOOST_FUSION_ADAPTED_DETAIL_STRUCT_ADAPT_STRUCT_HPP
-
-#include <boost/preprocessor/cat.hpp>
-
-#define BOOST_FUSION_ADAPT_STRUCT_FILLER_0(X, Y)\
- ((X, Y)) BOOST_FUSION_ADAPT_STRUCT_FILLER_1
-#define BOOST_FUSION_ADAPT_STRUCT_FILLER_1(X, Y)\
- ((X, Y)) BOOST_FUSION_ADAPT_STRUCT_FILLER_0
-#define BOOST_FUSION_ADAPT_STRUCT_FILLER_0_END
-#define BOOST_FUSION_ADAPT_STRUCT_FILLER_1_END
-
-#define BOOST_FUSION_ADAPT_STRUCT(NAME, SEQ)\
- BOOST_FUSION_ADAPT_STRUCT_BASE(\
- NAME,\
- assoc_struct_tag,\
- BOOST_PP_CAT(BOOST_FUSION_ADAPT_STRUCT_FILLER_0 SEQ,_END),\
- BOOST_FUSION_ADAPT_STRUCT_C)
-
-#define BOOST_FUSION_ADAPT_STRUCT_C(R, NAME, I, XY)\
- BOOST_FUSION_ADAPT_STRUCT_C_BASE(NAME, I, XY, 2)
-
-#endif

Modified: sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/struct/category_of_impl.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/struct/category_of_impl.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/struct/category_of_impl.hpp 2010-01-24 08:35:20 EST (Sun, 24 Jan 2010)
@@ -35,9 +35,7 @@
             template<typename Seq>
             struct apply
             {
- struct type
- : random_access_traversal_tag, associative_tag
- {};
+ typedef assoc_struct_category type;
             };
         };
     }

Modified: sandbox/SOC/2009/fusion/boost/fusion/adapted/struct/adapt_assoc_struct.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/adapted/struct/adapt_assoc_struct.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/adapted/struct/adapt_assoc_struct.hpp 2010-01-24 08:35:20 EST (Sun, 24 Jan 2010)
@@ -11,11 +11,11 @@
 #define BOOST_FUSION_ADAPTED_STRUCT_ADAPT_ASSOC_STRUCT_HPP
 
 #include <boost/fusion/support/internal/ref.hpp>
+#include <boost/preprocessor/cat.hpp>
+#include <boost/preprocessor/tuple/elem.hpp>
 
 #include <boost/fusion/adapted/detail/struct/extension.hpp>
 #include <boost/fusion/adapted/detail/struct/adapt_base.hpp>
-#include <boost/fusion/adapted/detail/struct/adapt_assoc_struct.hpp>
-
 #include <boost/fusion/adapted/detail/struct/at_impl.hpp>
 #include <boost/fusion/adapted/detail/struct/is_view_impl.hpp>
 #include <boost/fusion/adapted/detail/struct/is_sequence_impl.hpp>
@@ -30,4 +30,30 @@
 #include <boost/fusion/adapted/detail/struct/key_of_impl.hpp>
 #include <boost/fusion/adapted/detail/struct/value_of_data_impl.hpp>
 
+#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0(X, Y, Z)\
+ ((X, Y, Z)) BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_1
+#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_1(X, Y, Z)\
+ ((X, Y, Z)) BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0
+#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0_END
+#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_1_END
+
+#define BOOST_FUSION_ADAPT_ASSOC_STRUCT(NAME, SEQ)\
+ BOOST_FUSION_ADAPT_STRUCT_BASE(\
+ NAME,\
+ assoc_struct_tag,\
+ BOOST_PP_CAT(BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0 SEQ,_END),\
+ BOOST_FUSION_ADAPT_ASSOC_STRUCT_C)
+
+#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_C(R, NAME, I, XYZ) \
+ BOOST_FUSION_ADAPT_STRUCT_C_BASE(NAME, I, XYZ, 3) \
+ \
+namespace boost { namespace fusion { namespace extension \
+{ \
+ template<> \
+ struct struct_assoc_key<NAME, I> \
+ { \
+ typedef BOOST_PP_TUPLE_ELEM(3, 2, XYZ) type; \
+ }; \
+}}}
+
 #endif

Modified: sandbox/SOC/2009/fusion/boost/fusion/adapted/struct/adapt_struct.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/adapted/struct/adapt_struct.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/adapted/struct/adapt_struct.hpp 2010-01-24 08:35:20 EST (Sun, 24 Jan 2010)
@@ -10,11 +10,10 @@
 #define BOOST_FUSION_ADAPTED_STRUCT_ADAPT_STRUCT_HPP
 
 #include <boost/fusion/support/internal/ref.hpp>
+#include <boost/preprocessor/cat.hpp>
 
 #include <boost/fusion/adapted/detail/struct/extension.hpp>
 #include <boost/fusion/adapted/detail/struct/adapt_base.hpp>
-#include <boost/fusion/adapted/detail/struct/adapt_struct.hpp>
-
 #include <boost/fusion/adapted/detail/struct/at_impl.hpp>
 #include <boost/fusion/adapted/detail/struct/is_view_impl.hpp>
 #include <boost/fusion/adapted/detail/struct/is_sequence_impl.hpp>
@@ -26,4 +25,21 @@
 #include <boost/fusion/adapted/detail/struct/value_of_impl.hpp>
 #include <boost/fusion/adapted/detail/struct/deref_impl.hpp>
 
+#define BOOST_FUSION_ADAPT_STRUCT_FILLER_0(X, Y)\
+ ((X, Y)) BOOST_FUSION_ADAPT_STRUCT_FILLER_1
+#define BOOST_FUSION_ADAPT_STRUCT_FILLER_1(X, Y)\
+ ((X, Y)) BOOST_FUSION_ADAPT_STRUCT_FILLER_0
+#define BOOST_FUSION_ADAPT_STRUCT_FILLER_0_END
+#define BOOST_FUSION_ADAPT_STRUCT_FILLER_1_END
+
+#define BOOST_FUSION_ADAPT_STRUCT(NAME, SEQ)\
+ BOOST_FUSION_ADAPT_STRUCT_BASE(\
+ NAME,\
+ struct_tag,\
+ BOOST_PP_CAT(BOOST_FUSION_ADAPT_STRUCT_FILLER_0 SEQ,_END),\
+ BOOST_FUSION_ADAPT_STRUCT_C)
+
+#define BOOST_FUSION_ADAPT_STRUCT_C(R, NAME, I, XY)\
+ BOOST_FUSION_ADAPT_STRUCT_C_BASE(NAME, I, XY, 2)
+
 #endif

Modified: sandbox/SOC/2009/fusion/boost/fusion/algorithm/query/ext_/find_if_s.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/algorithm/query/ext_/find_if_s.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/algorithm/query/ext_/find_if_s.hpp 2010-01-24 08:35:20 EST (Sun, 24 Jan 2010)
@@ -1,207 +1,234 @@
 /*=============================================================================
     Copyright (c) 2006 Eric Niebler
+ Copyright (c) 2010 Christopher Schmidt
 
     Distributed under the Boost Software License, Version 1.0. (See accompanying
     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 ==============================================================================*/
-#if !defined(FIND_IF_S_05152006_1027)
-#define FIND_IF_S_05152006_1027
 
-#include <boost/mpl/not.hpp>
-#include <boost/mpl/assert.hpp>
-#include <boost/mpl/eval_if.hpp>
-#include <boost/type_traits/is_const.hpp>
-#include <boost/utility/enable_if.hpp>
-#include <boost/type_traits/is_same.hpp>
-#include <boost/fusion/algorithm/query/find_if.hpp>
-#include <boost/fusion/container/list/cons.hpp>
+#ifndef BOOST_FUSION_ALGORITHM_QUERY_EXT_FIND_IF_S_HPP
+#define BOOST_FUSION_ALGORITHM_QUERY_EXT_FIND_IF_S_HPP
+
 #include <boost/fusion/sequence/intrinsic/ext_/segments.hpp>
+#include <boost/fusion/iterator/deref.hpp>
+#include <boost/fusion/container/list/cons.hpp>
+#include <boost/fusion/algorithm/query/find_if.hpp>
 #include <boost/fusion/view/ext_/segmented_iterator.hpp>
 #include <boost/fusion/view/ext_/segmented_iterator_range.hpp>
 #include <boost/fusion/support/ext_/is_segmented.hpp>
+#include <boost/mpl/not.hpp>
+#include <boost/mpl/eval_if.hpp>
+#include <boost/type_traits/is_same.hpp>
+#include <boost/type_traits/is_const.hpp>
+#include <boost/utility/enable_if.hpp>
 
-// fwd declarations
 namespace boost { namespace fusion
 {
     namespace detail
     {
- template<typename Sequence, typename Pred, bool IsSegmented = traits::is_segmented<Sequence>::value>
+ template<
+ typename Seq
+ , typename Where
+ , bool IsSegmented = traits::is_segmented<Seq>::value
+ >
+ struct is_found;
+
+ template<typename Seq,typename Where>
+ struct is_found<Seq, Where,false>
+ : mpl::not_<
+ result_of::equal_to<
+ Where
+ , typename result_of::end<Seq>::type
+ >
+ >
+ {};
+
+ template<typename Seq, typename Cons>
+ struct is_found<Seq, Cons, true>
+ : mpl::not_<is_same<nil, Cons> >
+ {};
+
+ template<
+ typename SegmentedRange
+ , typename Where
+ , typename Seq =
+ typename detail::remove_reference<
+ typename result_of::deref<
+ typename SegmentedRange::iterator_type
+ >::type
+ >::type
+ , bool IsSegmented = traits::is_segmented<Seq>::value
+ >
+ struct as_segmented_cons;
+
+ template<typename SegmentedRange, typename Where, typename Seq>
+ struct as_segmented_cons<SegmentedRange, Where, Seq, false>
+ {
+ typedef
+ cons<
+ SegmentedRange
+ , cons<segmented_range<Seq, Where, false> >
+ >
+ type;
+
+ static type
+ call(SegmentedRange const &range, Where const &where)
+ {
+ return fusion::make_cons(
+ range,
+ fusion::make_cons(
+ segmented_range<Seq, Where, false>(
+ fusion::deref(fusion::begin(range)),
+ where)
+ ));
+ }
+ };
+
+ template<typename SegmentedRange, typename Where, typename Seq>
+ struct as_segmented_cons<SegmentedRange, Where, Seq, true>
+ {
+ typedef cons<Seq, Where> type;
+
+ static type
+ call(Seq const& range, Where const& where)
+ {
+ return fusion::make_cons(range, where);
+ }
+ };
+
+ template<
+ typename Seq,
+ typename Pred,
+ bool IsSegmented = traits::is_segmented<Seq>::value
+ >
         struct static_find_if_s_recurse;
- }
 
- namespace result_of
- {
- template <typename Sequence, typename Pred>
- struct find_if_s;
- }
-}}
+ template<
+ typename SegmentedRange
+ , typename Pred
+ , bool IsEmpty = is_empty<SegmentedRange>::value
+ >
+ struct static_find_if_s_seg
+ {
+ typedef typename
+ detail::remove_reference<
+ typename result_of::deref<
+ typename SegmentedRange::iterator_type
+ >::type
+ >::type
+ segment;
+ typedef static_find_if_s_recurse<segment, Pred> where;
+ typedef is_found<segment, typename where::type> is_found_;
+ typedef
+ as_segmented_cons<SegmentedRange, typename where::type>
+ found;
+ typedef
+ static_find_if_s_seg<
+ typename range_next<SegmentedRange>::type
+ , Pred
+ >
+ not_found;
 
-namespace boost { namespace fusion { namespace detail
-{
+ typedef typename
+ mpl::eval_if<is_found_, found, not_found>::type
+ type;
 
- template<typename Sequence, typename Where, bool IsSegmented = traits::is_segmented<Sequence>::value>
- struct is_found
- : mpl::not_<result_of::equal_to<Where, typename result_of::end<Sequence>::type> >
- {};
-
- template<typename Sequence, typename Cons>
- struct is_found<Sequence, Cons, true>
- : mpl::not_<is_same<nil, Cons> >
- {};
-
- template<
- typename SegmentedRange
- , typename Where
- , typename Sequence = typename remove_reference<
- typename result_of::deref<
- typename SegmentedRange::iterator_type
- >::type
- >::type
- , bool IsSegmented = traits::is_segmented<Sequence>::value
- >
- struct as_segmented_cons
- {
- typedef cons<
- SegmentedRange
- , cons<segmented_range<Sequence, Where, false> >
- > type;
-
- static type call(SegmentedRange const &range, Where const &where)
- {
- return fusion::make_cons(
- range
- , fusion::make_cons(
- segmented_range<Sequence, Where, false>(*fusion::begin(range), where)
- )
- );
- }
- };
-
- template<
- typename SegmentedRange
- , typename Where
- , typename Sequence
- >
- struct as_segmented_cons<SegmentedRange, Where, Sequence, true>
- {
- typedef cons<SegmentedRange, Where> type;
+ static type
+ call(SegmentedRange const& range)
+ {
+ return call_(range, is_found_());
+ }
+
+ private:
+ static type call_(SegmentedRange const& range, mpl::true_)
+ {
+ return found::call(range, where::call(*range.where_));
+ }
+
+ static type call_(SegmentedRange const& range, mpl::false_)
+ {
+ return not_found::call(range_next<SegmentedRange>::call(range));
+ }
+ };
 
- static type call(SegmentedRange const &range, Where const &where)
+ template<
+ typename SegmentedRange
+ , typename Pred
+ >
+ struct static_find_if_s_seg<SegmentedRange, Pred, true>
+ {
+ typedef nil type;
+
+ static type call(SegmentedRange const&)
+ {
+ return nil();
+ }
+ };
+
+ template<typename Seq, typename Pred>
+ struct static_find_if_s_recurse<Seq, Pred, true>
         {
- return fusion::make_cons(range, where);
- }
- };
-
- template<
- typename SegmentedRange
- , typename Pred
- , bool IsEmpty = is_empty<SegmentedRange>::value
- >
- struct static_find_if_s_seg
- {
- typedef typename SegmentedRange::iterator_type first;
- typedef typename result_of::deref<first>::type segment_ref;
- typedef typename remove_reference<segment_ref>::type segment;
- typedef static_find_if_s_recurse<segment, Pred> where;
- typedef range_next<SegmentedRange> next;
- typedef is_found<segment, typename where::type> is_found;
- typedef as_segmented_cons<SegmentedRange, typename where::type> found;
- typedef static_find_if_s_seg<typename next::type, Pred> not_found;
- typedef typename mpl::eval_if<is_found, found, not_found>::type type;
-
- static type call(SegmentedRange const &range)
- {
- return call_(range, is_found());
- }
-
- private:
- static type call_(SegmentedRange const &range, mpl::true_)
- {
- return found::call(range, where::call(*range.where_));
- }
-
- static type call_(SegmentedRange const &range, mpl::false_)
- {
- return not_found::call(next::call(range));
- }
- };
-
- template<
- typename SegmentedRange
- , typename Pred
- >
- struct static_find_if_s_seg<SegmentedRange, Pred, true>
- {
- typedef nil type;
+ typedef
+ static_find_if_s_seg<
+ typename as_segmented_range<Seq>::type,
+ Pred
+ >
+ find_if;
+
+ typedef typename find_if::type type;
+
+ static type
+ call(Seq& seq)
+ {
+ return find_if::call(range(fusion::segments(seq)));
+ }
+ };
 
- static type call(SegmentedRange const &)
+ template<typename Seq, typename Pred>
+ struct static_find_if_s_recurse<Seq, Pred, false>
         {
- return nil();
- }
- };
+ typedef typename result_of::find_if<Seq, Pred>::type type;
 
- template<typename Sequence, typename Pred>
- struct static_find_if_s_recurse<Sequence, Pred, true>
- {
- typedef typename as_segmented_range<Sequence>::type range;
- typedef static_find_if_s_seg<range, Pred> find_if;
- typedef typename find_if::type type;
-
- static type call(Sequence &seq)
- {
- return find_if::call(range(fusion::segments(seq)));
- }
- };
+ static type
+ call(Seq& seq)
+ {
+ return fusion::find_if<Pred>(seq);
+ }
+ };
 
- template<typename Sequence, typename Pred>
- struct static_find_if_s_recurse<Sequence, Pred, false>
- {
- typedef typename result_of::find_if<Sequence, Pred>::type type;
+ template<typename Sequence, typename Pred, bool IsSegmented = traits::is_segmented<Sequence>::value>
+ struct static_find_if_s;
 
- static type call(Sequence &seq)
- {
- return fusion::find_if<Pred>(seq);
- }
- };
-
- template<typename Sequence, typename Pred, bool IsSegmented = traits::is_segmented<Sequence>::value>
- struct static_find_if_s
- : static_find_if_s_recurse<Sequence, Pred, IsSegmented>
- {};
+ template<typename Seq, typename Pred>
+ struct static_find_if_s<Seq,Pred,false>
+ : static_find_if_s_recurse<Seq, Pred, false>
+ {};
+
+ template<typename Seq, typename Pred>
+ struct static_find_if_s<Seq, Pred, true>
+ {
+ typedef typename as_segmented_range<Seq>::type range;
+ typedef static_find_if_s_recurse<Seq, Pred> find_if;
+ typedef typename find_if::type found;
+
+ typedef segmented_iterator<typename reverse_cons<found>::type> type;
+
+ static type call(Seq& seq)
+ {
+ return type(reverse_cons<found>::call(find_if::call(seq)));
+ }
+ };
+ }
     
- template<typename Sequence, typename Pred>
- struct static_find_if_s<Sequence, Pred, true>
- {
- typedef typename as_segmented_range<Sequence>::type range;
- typedef static_find_if_s_recurse<Sequence, Pred> find_if;
- typedef typename find_if::type found;
-
- typedef segmented_iterator<typename reverse_cons<found>::type> type;
-
- static type call(Sequence &seq)
- {
- return type(reverse_cons<found>::call(find_if::call(seq)));
- }
- };
-}}}
-
-namespace boost { namespace fusion
-{
     namespace result_of
     {
- template <typename Sequence, typename Pred>
+ template <typename Seq, typename Pred>
         struct find_if_s
- {
- typedef typename
- detail::static_find_if_s<
- Sequence
- , Pred
- >::type
- type;
- };
+ : detail::static_find_if_s<Seq, Pred>
+ {};
     }
 
- template <typename Pred, typename Sequence>
+ template<typename Pred, typename Sequence>
     typename lazy_disable_if<
         is_const<Sequence>
       , result_of::find_if_s<Sequence, Pred>

Modified: sandbox/SOC/2009/fusion/boost/fusion/container/list/detail/build_cons.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/container/list/detail/build_cons.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/container/list/detail/build_cons.hpp 2010-01-24 08:35:20 EST (Sun, 24 Jan 2010)
@@ -18,7 +18,8 @@
     template <
         typename Begin
       , typename End
- , bool is_empty = result_of::equal_to<Begin, End>::value>
+ , bool is_empty = result_of::equal_to<Begin, End>::value
+ >
     struct build_cons;
 
     template <typename Begin, typename End>

Modified: sandbox/SOC/2009/fusion/boost/fusion/container/map/detail/deref_data_impl.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/container/map/detail/deref_data_impl.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/container/map/detail/deref_data_impl.hpp 2010-01-24 08:35:20 EST (Sun, 24 Jan 2010)
@@ -34,7 +34,7 @@
             static type
             call(It it)
             {
- return deref(it).second;
+ return fusion::deref(it).second;
             }
         };
     };

Modified: sandbox/SOC/2009/fusion/boost/fusion/container/map/detail/deref_impl.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/container/map/detail/deref_impl.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/container/map/detail/deref_impl.hpp 2010-01-24 08:35:20 EST (Sun, 24 Jan 2010)
@@ -38,7 +38,7 @@
             static type
             call(It it_)
             {
- return at<typename it::index>(it_.seq->get_data());
+ return fusion::at<typename it::index>(it_.seq->get_data());
             }
         };
     };

Modified: sandbox/SOC/2009/fusion/boost/fusion/container/set/detail/deref_impl.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/container/set/detail/deref_impl.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/container/set/detail/deref_impl.hpp 2010-01-24 08:35:20 EST (Sun, 24 Jan 2010)
@@ -38,7 +38,7 @@
             static type
             call(It it_)
             {
- return at<typename it::index>(it_.seq->get_data());
+ return fusion::at<typename it::index>(it_.seq->get_data());
             }
         };
     };

Modified: sandbox/SOC/2009/fusion/boost/fusion/container/vector/detail/variadic_templates/tagged_impl.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/container/vector/detail/variadic_templates/tagged_impl.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/container/vector/detail/variadic_templates/tagged_impl.hpp 2010-01-24 08:35:20 EST (Sun, 24 Jan 2010)
@@ -24,14 +24,14 @@
     static typename add_lref<T>::type
     at_helper(element<I,T>& element)
     {
- return element._element;
+ return element.element;
     }
 
     template<int I, typename T>
     static typename add_lref<typename add_const<T>::type>::type
     at_helper(element<I,T>const& element)
     {
- return element._element;
+ return element.element;
     }
 }}}
 

Modified: sandbox/SOC/2009/fusion/boost/fusion/container/vector/detail/variadic_templates/vector.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/container/vector/detail/variadic_templates/vector.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/container/vector/detail/variadic_templates/vector.hpp 2010-01-24 08:35:20 EST (Sun, 24 Jan 2010)
@@ -74,15 +74,15 @@
         template<int I, typename Element>
         struct element
         {
- Element _element;
+ Element element;
 
             element()
- : _element()
+ : element()
             {}
 
             template<typename It>
             element(assign_by_deref,It const& it)
- : _element(fusion::deref(fusion::advance_c<I>(it)))
+ : element(fusion::deref(fusion::advance_c<I>(it)))
             {}
 
 #ifndef BOOST_NO_RVALUE_REFERENCES
@@ -96,7 +96,7 @@
                 OtherArgument&& argument
 #endif
                 )
- : _element(BOOST_FUSION_FORWARD(OtherArgument,argument))
+ : element(BOOST_FUSION_FORWARD(OtherArgument,argument))
             {}
         };
 
@@ -178,14 +178,14 @@
         };
 
 # define BOOST_FUSION_UNROLLED_VECTOR_MEMBER_DEFAULT_INIT(Z,N,_)\
- BOOST_PP_CAT(_element,N)()
+ BOOST_PP_CAT(element,N)()
 
 # define BOOST_FUSION_UNROLLED_VECTOR_MEMBER_DEREF_ASSIGN_PARAMS(Z,N,_)\
- BOOST_PP_CAT(_element,N)(\
+ BOOST_PP_CAT(element,N)(\
             fusion::deref(fusion::advance_c<N>(it)))
 
 # define BOOST_FUSION_UNROLLED_VECTOR_MEMBER_DEREF_ASSIGN(Z,N,_)\
- BOOST_PP_CAT(_element,N)=fusion::deref(BOOST_PP_CAT(it,N));\
+ BOOST_PP_CAT(element,N)=fusion::deref(BOOST_PP_CAT(it,N));\
         \
         typedef typename\
             result_of::next<BOOST_PP_CAT(It,N)>::type\
@@ -207,7 +207,7 @@
 # endif
 
 # define BOOST_FUSION_UNROLLED_VECTOR_DIRECT_ASSIGN(Z,N,_)\
- BOOST_PP_CAT(_element,N)(BOOST_PP_CAT(_,N))
+ BOOST_PP_CAT(element,N)(BOOST_PP_CAT(_,N))
 
 # ifdef BOOST_FUSION_PREFER_MPL
 # define BOOST_FUSION_META_VALUE_AT(N)
@@ -222,7 +222,7 @@
         typename add_lref<BOOST_PP_CAT(H,N)>::type\
         at_impl(mpl::int_<I+N>)\
         {\
- return BOOST_PP_CAT(_element,N) ;\
+ return BOOST_PP_CAT(element,N) ;\
         }\
         \
         typename add_lref<\
@@ -230,10 +230,10 @@
>::type\
         at_impl(mpl::int_<I+N>)const\
         {\
- return BOOST_PP_CAT(_element,N) ;\
+ return BOOST_PP_CAT(element,N) ;\
         }\
         \
- BOOST_PP_CAT(H,N) BOOST_PP_CAT(_element,N);
+ BOOST_PP_CAT(H,N) BOOST_PP_CAT(element,N);
 
 # define BOOST_FUSION_UNROLLED_VECTOR_IMPL(Z, N, MAX)\
         template<int I, BOOST_PP_ENUM_PARAMS(N, typename H)>\

Added: sandbox/SOC/2009/fusion/boost/fusion/include/adapt_assoc_class.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/fusion/boost/fusion/include/adapt_assoc_class.hpp 2010-01-24 08:35:20 EST (Sun, 24 Jan 2010)
@@ -0,0 +1,13 @@
+/*=============================================================================
+ Copyright (c) 2010 Christopher Schmidt
+
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+==============================================================================*/
+
+#ifndef BOOST_FUSION_INCLUDE_ADAPT_ASSOC_CLASS_HPP
+#define BOOST_FUSION_INCLUDE_ADAPT_ASSOC_CLASS_HPP
+
+#include <boost/fusion/adapted/class/adapt_assoc_class.hpp>
+
+#endif

Added: sandbox/SOC/2009/fusion/boost/fusion/include/adapt_class.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/fusion/boost/fusion/include/adapt_class.hpp 2010-01-24 08:35:20 EST (Sun, 24 Jan 2010)
@@ -0,0 +1,13 @@
+/*=============================================================================
+ Copyright (c) 2001-2007 Joel de Guzman
+
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+==============================================================================*/
+
+#ifndef BOOST_FUSION_INCLUDE_ADAPT_CLASS_HPP
+#define BOOST_FUSION_INCLUDE_ADAPT_CLASS_HPP
+
+#include <boost/fusion/adapted/class/adapt_class.hpp>
+
+#endif

Modified: sandbox/SOC/2009/fusion/boost/fusion/sequence/intrinsic/ext_/segments.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/sequence/intrinsic/ext_/segments.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/sequence/intrinsic/ext_/segments.hpp 2010-01-24 08:35:20 EST (Sun, 24 Jan 2010)
@@ -1,56 +1,71 @@
 /*=============================================================================
     Copyright (c) 2006 Eric Niebler
+ Copyright (c) 2010 Christopher Schmidt
 
     Distributed under the Boost Software License, Version 1.0. (See accompanying
     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 ==============================================================================*/
-#if !defined(FUSION_SEGMENTS_04052005_1141)
-#define FUSION_SEGMENTS_04052005_1141
+
+#ifndef BOOST_FUSION_SEQUENCE_INTRINSIC_EXT_SEGMENTS_HPP
+#define BOOST_FUSION_SEQUENCE_INTRINSIC_EXT_SEGMENTS_HPP
 
 #include <boost/fusion/support/tag_of.hpp>
+#include <boost/fusion/support/internal/assert.hpp>
+#ifdef BOOST_FUSION_ENABLE_STATIC_ASSERTS
+# include <boost/fusion/supported/ext_/is_segmented.hpp>
+#endif
 
 namespace boost { namespace fusion
 {
- // segments: returns a sequence of sequences
     namespace extension
     {
- template <typename Tag>
- struct segments_impl
- {
- template <typename Sequence>
- struct apply {};
- };
+ template <typename>
+ struct segments_impl;
     }
 
     namespace result_of
     {
- template <typename Sequence>
+ template<typename Seq>
         struct segments
+ : extension::segments_impl<
+ typename traits::tag_of<Seq>::type
+ >::template apply<Seq>
         {
- typedef typename
- extension::segments_impl<typename traits::tag_of<Sequence>::type>::
- template apply<Sequence>::type
- type;
+ BOOST_FUSION_MPL_ASSERT((traits::is_sequence<Seq>));
+ BOOST_FUSION_MPL_ASSERT((traits::is_segmented<Seq>));
         };
     }
 
- template <typename Sequence>
- typename result_of::segments<Sequence>::type
- segments(Sequence & seq)
- {
- return
- extension::segments_impl<typename traits::tag_of<Sequence>::type>::
- template apply<Sequence>::call(seq);
+ /*template<typename Seq>
+ typename result_of::segments<Seq>::type
+ segments(Seq& seq)
+ {
+ return result_of::segments<Seq>::call(seq);
+ }
+
+ template<typename Seq>
+ typename result_of::segments<Seq const>::type
+ segments(Seq const& seq)
+ {
+ return result_of::segments<Seq const>::call(seq);
+ }*/
+
+ template<typename Seq>
+ typename result_of::segments<BOOST_FUSION_R_ELSE_CLREF(Seq)>::type
+ segments(BOOST_FUSION_R_ELSE_CLREF(Seq) seq)
+ {
+ return result_of::segments<BOOST_FUSION_R_ELSE_CLREF(Seq)>::call(
+ BOOST_FUSION_FORWARD(Seq,seq));
     }
 
- template <typename Sequence>
- typename result_of::segments<Sequence const>::type
- segments(Sequence const& seq)
- {
- return
- extension::segments_impl<typename traits::tag_of<Sequence>::type>::
- template apply<Sequence const>::call(seq);
+#ifdef BOOST_NO_RVALUE_REFERENCES
+ template<typename Seq>
+ typename result_of::segments<Seq&>::type
+ segments(Seq& seq)
+ {
+ return result_of::segments<Seq&>::call(seq);
     }
+#endif
 }}
 
 #endif

Modified: sandbox/SOC/2009/fusion/boost/fusion/sequence/intrinsic/ext_/size_s.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/sequence/intrinsic/ext_/size_s.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/sequence/intrinsic/ext_/size_s.hpp 2010-01-24 08:35:20 EST (Sun, 24 Jan 2010)
@@ -1,25 +1,31 @@
 /*=============================================================================
     Copyright (c) 2006 Eric Niebler
+ Copyright (c) 2010 Christopher Schmidt
 
     Distributed under the Boost Software License, Version 1.0. (See accompanying
     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 ==============================================================================*/
-#if !defined(FUSION_SIZE_S_08112006_1141)
-#define FUSION_SIZE_S_08112006_1141
 
-#include <boost/mpl/plus.hpp>
-#include <boost/mpl/size_t.hpp>
-#include <boost/type_traits/remove_reference.hpp>
+#ifndef BOOST_FUSION_SEQUENCE_INTRINSIC_EXT_SIZE_S_HPP
+#define BOOST_FUSION_SEQUENCE_INTRINSIC_EXT_SIZE_S_HPP
+
+#include <boost/fusion/sequence/intrinsic/ext_/segments.hpp>
 #include <boost/fusion/algorithm/iteration/fold.hpp>
 #include <boost/fusion/support/ext_/is_segmented.hpp>
-#include <boost/fusion/sequence/intrinsic/ext_/segments.hpp>
+#include <boost/fusion/support/internal/ref.hpp>
+#include <boost/mpl/plus.hpp>
+#include <boost/mpl/size_t.hpp>
 
 namespace boost { namespace fusion
 {
- ///////////////////////////////////////////////////////////////////////////
- // calculates the size of any segmented data structure.
- template<typename Sequence, bool IsSegmented = traits::is_segmented<Sequence>::value>
- struct segmented_size;
+ namespace result_of
+ {
+ template<
+ typename Sequence
+ , bool IsSegmented = traits::is_segmented<Sequence>::value
+ >
+ struct segmented_size;
+ }
 
     namespace detail
     {
@@ -28,10 +34,10 @@
             template<typename Sig>
             struct result;
 
- template<typename This, typename State, typename Seq>
- struct result<This(State, Seq)>
+ template<typename Self, typename State, typename Seq>
+ struct result<Self(State, Seq)>
               : mpl::plus<
- segmented_size<
+ result_of::segmented_size<
                         typename detail::remove_reference<Seq>::type
>
                   , typename detail::remove_reference<State>::type
@@ -44,22 +50,24 @@
         };
     }
 
- ///////////////////////////////////////////////////////////////////////////
- template<typename Sequence, bool IsSegmented>
- struct segmented_size
- : detail::remove_reference<
- typename result_of::fold<
- typename result_of::segments<Sequence>::type
- , mpl::size_t<0>
- , detail::size_plus
+ namespace result_of
+ {
+ template<typename Seq>
+ struct segmented_size<Seq, true>
+ : detail::remove_reference<
+ typename result_of::fold<
+ typename result_of::segments<Seq>::type
+ , mpl::size_t<0>
+ , detail::size_plus
+ >::type
>::type
- >::type
- {};
+ {};
 
- template<typename Sequence>
- struct segmented_size<Sequence, false>
- : result_of::size<Sequence>
- {};
+ template<typename Seq>
+ struct segmented_size<Seq, false>
+ : result_of::size<Seq>
+ {};
+ }
 }}
 
 #endif

Modified: sandbox/SOC/2009/fusion/boost/fusion/support/ext_/is_segmented.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/support/ext_/is_segmented.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/support/ext_/is_segmented.hpp 2010-01-24 08:35:20 EST (Sun, 24 Jan 2010)
@@ -1,47 +1,37 @@
 /*=============================================================================
     Copyright (c) 2006 Eric Niebler
+ Copyright (c) 2010 Christopher Schmidt
 
     Distributed under the Boost Software License, Version 1.0. (See accompanying
     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 ==============================================================================*/
-#if !defined(FUSION_IS_SEGMENTED_03202006_0015)
-#define FUSION_IS_SEGMENTED_03202006_0015
+
+#ifndef BOOST_FUSION_SUPPORT_EXT_IS_SEGMENTED_HPP
+#define BOOST_FUSION_SUPPORT_EXT_IS_SEGMENTED_HPP
 
 #include <boost/fusion/support/tag_of.hpp>
 
 namespace boost { namespace fusion
 {
- // Special tags:
- struct sequence_facade_tag;
- struct boost_tuple_tag; // boost::tuples::tuple tag
- struct array_tag; // boost::array tag
- struct mpl_sequence_tag; // mpl sequence tag
- struct std_pair_tag; // std::pair tag
- struct iterator_range_tag;
-
     namespace extension
     {
         template<typename Tag>
         struct is_segmented_impl
         {
- template<typename Sequence>
+ template<typename Seq>
             struct apply
               : mpl::false_
             {};
         };
-
- template<>
- struct is_segmented_impl<iterator_range_tag>;
     }
 
     namespace traits
     {
- template <typename Sequence>
+ template<typename Seq>
         struct is_segmented
- : extension::is_segmented_impl<typename traits::tag_of<Sequence>::type>::
- template apply<Sequence>
- {
- };
+ : extension::is_segmented_impl<typename traits::tag_of<Seq>::type>::
+ template apply<Seq>
+ {};
     }
 }}
 

Deleted: sandbox/SOC/2009/fusion/boost/fusion/view/ext_/multiple_view.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/view/ext_/multiple_view.hpp 2010-01-24 08:35:20 EST (Sun, 24 Jan 2010)
+++ (empty file)
@@ -1,187 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2006 Eric Niebler
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-==============================================================================*/
-#ifndef FUSION_MULTIPLE_VIEW_05052005_0335
-#define FUSION_MULTIPLE_VIEW_05052005_0335
-
-#include <boost/mpl/int.hpp>
-#include <boost/mpl/bool.hpp>
-#include <boost/mpl/next.hpp>
-#include <boost/fusion/support/detail/access.hpp>
-#include <boost/fusion/support/sequence_base.hpp>
-#include <boost/fusion/support/iterator_base.hpp>
-#include <boost/fusion/support/detail/as_fusion_element.hpp>
-
-namespace boost { namespace fusion
-{
- struct multiple_view_tag;
- struct forward_traversal_tag;
- struct fusion_sequence_tag;
-
- template<typename Size, typename T>
- struct multiple_view
- : sequence_base<multiple_view<Size, T> >
- {
- typedef multiple_view_tag fusion_tag;
- typedef fusion_sequence_tag tag; // this gets picked up by MPL
- typedef forward_traversal_tag category;
- typedef mpl::true_ is_view;
- typedef mpl::int_<Size::value> size;
- typedef T value_type;
-
- multiple_view()
- : val()
- {}
-
- explicit multiple_view(typename detail::call_param<T>::type val)
- : val(val)
- {}
-
- value_type val;
- };
-
- template<typename Size, typename T>
- inline multiple_view<Size, typename detail::as_fusion_element<T>::type>
- make_multiple_view(T const& v)
- {
- return multiple_view<Size, typename detail::as_fusion_element<T>::type>(v);
- }
-
- struct multiple_view_iterator_tag;
- struct forward_traversal_tag;
-
- template<typename Index, typename MultipleView>
- struct multiple_view_iterator
- : iterator_base<multiple_view_iterator<Index, MultipleView> >
- {
- typedef multiple_view_iterator_tag fusion_tag;
- typedef forward_traversal_tag category;
- typedef typename MultipleView::value_type value_type;
- typedef MultipleView multiple_view_type;
- typedef Index index;
-
- explicit multiple_view_iterator(multiple_view_type const &view_)
- : view(view_)
- {}
-
- multiple_view_type view;
- };
-
- namespace extension
- {
- template <typename Tag>
- struct next_impl;
-
- template <>
- struct next_impl<multiple_view_iterator_tag>
- {
- template <typename Iterator>
- struct apply
- {
- typedef typename detail::remove_reference<Iterator>::type it;
-
- typedef multiple_view_iterator<
- typename mpl::next<typename it::index>::type
- , typename it::multiple_view_type
- > type;
-
- static type
- call(Iterator where)
- {
- return type(where.view);
- }
- };
- };
-
- template <typename Tag>
- struct end_impl;
-
- template <>
- struct end_impl<multiple_view_tag>
- {
- template <typename Sequence>
- struct apply
- {
- typedef typename detail::remove_reference<Sequence>::type seq;
-
- typedef multiple_view_iterator<
- typename seq::size
- , seq
- > type;
-
- static type
- call(Sequence seq)
- {
- return type(seq);
- }
- };
- };
-
- template <typename Tag>
- struct deref_impl;
-
- template <>
- struct deref_impl<multiple_view_iterator_tag>
- {
- template <typename Iterator>
- struct apply
- {
- typedef typename detail::remove_reference<Iterator>::type it;
- typedef typename it::value_type type;
-
- static type
- call(Iterator i)
- {
- return i.view.val;
- }
- };
- };
-
- template <typename Tag>
- struct begin_impl;
-
- template <>
- struct begin_impl<multiple_view_tag>
- {
- template <typename Sequence>
- struct apply
- {
- typedef typename detail::remove_reference<Sequence>::type seq;
-
- typedef multiple_view_iterator<
- mpl::int_<0>
- , seq
- > type;
-
- static type
- call(Sequence seq)
- {
- return type(seq);
- }
- };
- };
-
- template <typename Tag>
- struct value_of_impl;
-
- template <>
- struct value_of_impl<multiple_view_iterator_tag>
- {
- template <typename Iterator>
- struct apply
- {
- typedef typename detail::remove_reference<Iterator>::type it;
-
- typedef typename it::multiple_view_type multiple_view_type;
- typedef typename multiple_view_type::value_type type;
- };
- };
- }
-}}
-
-#endif
-
-

Modified: sandbox/SOC/2009/fusion/boost/fusion/view/ext_/segmented_iterator.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/view/ext_/segmented_iterator.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/view/ext_/segmented_iterator.hpp 2010-01-24 08:35:20 EST (Sun, 24 Jan 2010)
@@ -1,82 +1,56 @@
 /*=============================================================================
- Copyright (c) 2006 Eric Niebler
+ Copyright (c) 2006 Eric Niebler
+ Copyright (c) 2010 Christopher Schmidt
 
- Use, modification and distribution is subject to the Boost Software
- License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
- http://www.boost.org/LICENSE_1_0.txt)
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 ==============================================================================*/
-#ifndef FUSION_SEGMENTED_ITERATOR_EAN_05032006_1027
-#define FUSION_SEGMENTED_ITERATOR_EAN_05032006_1027
 
+#ifndef BOOST_FUSION_VIEW_EXT_SEGMENTED_ITERATOR_HPP
+#define BOOST_FUSION_VIEW_EXT_SEGMENTED_ITERATOR_HPP
+
+#include <boost/fusion/sequence/intrinsic/ext_/segments.hpp>
+#include <boost/fusion/sequence/intrinsic/empty.hpp>
+#include <boost/fusion/container/list/cons.hpp>
+#include <boost/fusion/container/generation/make_cons.hpp>
+#include <boost/fusion/iterator/distance.hpp>
+#include <boost/fusion/view/filter_view.hpp>
+#include <boost/fusion/support/tag_of.hpp>
+#include <boost/fusion/support/is_sequence.hpp>
+#include <boost/fusion/support/ext_/is_segmented.hpp>
+#include <boost/fusion/support/internal/ref.hpp>
+#include <boost/type_traits/is_same.hpp>
 #include <boost/mpl/if.hpp>
 #include <boost/mpl/not.hpp>
 #include <boost/mpl/assert.hpp>
 #include <boost/mpl/placeholders.hpp>
-#include <boost/type_traits/is_same.hpp>
-#include <boost/type_traits/is_reference.hpp>
-#include <boost/type_traits/remove_reference.hpp>
-#include <boost/fusion/support/tag_of.hpp>
-#include <boost/fusion/support/is_sequence.hpp>
-#include <boost/fusion/view/filter_view.hpp>
-#include <boost/fusion/container/list/cons.hpp> // for nil
-#include <boost/fusion/container/generation/make_cons.hpp>
-#include <boost/fusion/iterator/distance.hpp>
-#include <boost/fusion/sequence/intrinsic/ext_/segments.hpp>
-#include <boost/fusion/support/ext_/is_segmented.hpp>
 
 namespace boost { namespace fusion
 {
     struct fusion_sequence_tag;
+ struct segmented_range_tag;
 
     namespace detail
     {
- using mpl::_;
- using mpl::not_;
-
- ////////////////////////////////////////////////////////////////////////////
- template<typename Sequence>
- struct is_empty
- : result_of::equal_to<
- typename result_of::begin<Sequence>::type
- , typename result_of::end<Sequence>::type
- >
- {};
-
- template<typename Sequence>
- struct is_empty<Sequence &>
- : is_empty<Sequence>
- {};
-
- ////////////////////////////////////////////////////////////////////////////
- struct not_is_empty_pred
- {
- template<typename Sequence>
- struct apply
- : not_<is_empty<Sequence> >
- {};
- };
-
- struct segmented_range_tag;
-
- ////////////////////////////////////////////////////////////////////////////
         template<typename Sequence, typename Iterator, bool IsSegmented>
         struct segmented_range
           : sequence_base<segmented_range<Sequence, Iterator, IsSegmented> >
         {
- BOOST_MPL_ASSERT_NOT((is_reference<Sequence>));
             typedef mpl::bool_<IsSegmented> is_segmented;
+ // If this is a range of segments, skip over the empty ones
+ typedef typename
+ mpl::if_c<
+ IsSegmented
+ , filter_view<Sequence, mpl::not_<result_of::empty<mpl::_1> > >
+ , Sequence
+ >::type
+ sequence_non_ref_type;
+
             typedef segmented_range_tag fusion_tag;
- typedef fusion_sequence_tag tag; // this gets picked up by MPL
+ typedef fusion_sequence_tag tag;
             typedef mpl::true_ is_view;
             typedef Iterator iterator_type;
 
- // If this is a range of segments, skip over the empty ones
- typedef typename mpl::if_<
- is_segmented
- , filter_view<Sequence, not_is_empty_pred>
- , Sequence
- >::type sequence_non_ref_type;
-
             typedef typename mpl::if_<
                 traits::is_view<sequence_non_ref_type>
               , sequence_non_ref_type
@@ -103,7 +77,7 @@
     namespace extension
     {
         template<>
- struct is_segmented_impl<detail::segmented_range_tag>
+ struct is_segmented_impl<segmented_range_tag>
         {
             template<typename Sequence>
             struct apply
@@ -112,7 +86,7 @@
         };
 
         template<>
- struct size_impl<detail::segmented_range_tag>
+ struct size_impl<segmented_range_tag>
         {
             template<typename Sequence>
             struct apply
@@ -129,7 +103,7 @@
         };
 
         template<>
- struct segments_impl<detail::segmented_range_tag>
+ struct segments_impl<segmented_range_tag>
         {
             template<typename Sequence>
             struct apply
@@ -143,7 +117,7 @@
         };
 
         template<>
- struct begin_impl<detail::segmented_range_tag>
+ struct begin_impl<segmented_range_tag>
         {
             template<typename Sequence>
             struct apply
@@ -160,7 +134,7 @@
         };
 
         template<>
- struct end_impl<detail::segmented_range_tag>
+ struct end_impl<segmented_range_tag>
         {
             template<typename Sequence>
             struct apply
@@ -199,7 +173,7 @@
         ///////////////////////////////////////////////////////////////////////
         template<typename Cons>
         struct is_range_next_empty
- : is_empty<typename range_next<typename Cons::car_type>::type>
+ : result_of::empty<typename range_next<typename Cons::car_type>::type>
         {};
 
         template<>
@@ -213,7 +187,7 @@
         {
             typedef typename result_of::segments<Sequence>::type segments;
             typedef typename remove_reference<segments>::type sequence;
- typedef typename result_of::begin<filter_view<sequence, not_is_empty_pred> >::type begin;
+ typedef typename result_of::begin<filter_view<sequence, mpl::not_<result_of::empty<mpl::_1> > > >::type begin;
             typedef segmented_range<sequence, begin, true> type;
 
             static type call(Sequence &seq)
@@ -252,7 +226,10 @@
           , typename State = nil
           , bool IsSegmented = traits::is_segmented<Sequence>::value
>
- struct push_segments
+ struct push_segments;
+
+ template<typename Sequence, typename State>
+ struct push_segments<Sequence, State, true>
         {
             typedef typename as_segmented_range<Sequence>::type range;
             typedef typename result_of::begin<range>::type begin;

Modified: sandbox/SOC/2009/fusion/boost/fusion/view/ext_/segmented_iterator_range.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/view/ext_/segmented_iterator_range.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/view/ext_/segmented_iterator_range.hpp 2010-01-24 08:35:20 EST (Sun, 24 Jan 2010)
@@ -1,12 +1,13 @@
 /*=============================================================================
- Copyright (c) 2006 Eric Niebler
+ Copyright (c) 2006 Eric Niebler
+ Copyright (c) 2010 Christopher Schmidt
 
- Use, modification and distribution is subject to the Boost Software
- License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
- http://www.boost.org/LICENSE_1_0.txt)
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 ==============================================================================*/
-#ifndef FUSION_SEGMENTED_ITERATOR_RANGE_EAN_05032006_1027
-#define FUSION_SEGMENTED_ITERATOR_RANGE_EAN_05032006_1027
+
+#ifndef BOOST_FUSION_VIEW_EXT_SEGMENTED_ITERATOR_RANGE_HPP
+#define BOOST_FUSION_VIEW_EXT_SEGMENTED_ITERATOR_RANGE_HPP
 
 #include <boost/mpl/bool.hpp>
 #include <boost/mpl/minus.hpp>
@@ -14,15 +15,13 @@
 #include <boost/mpl/and.hpp>
 #include <boost/type_traits/remove_cv.hpp>
 #include <boost/type_traits/remove_reference.hpp>
-#include <boost/fusion/iterator/mpl/convert_iterator.hpp>
 #include <boost/fusion/container/list/cons.hpp>
 #include <boost/fusion/view/joint_view.hpp>
 #include <boost/fusion/view/single_view.hpp>
 #include <boost/fusion/view/transform_view.hpp>
 #include <boost/fusion/view/iterator_range.hpp>
-#include <boost/fusion/view/ext_/multiple_view.hpp>
+#include <boost/fusion/view/repetitive_view.hpp>
 #include <boost/fusion/view/ext_/segmented_iterator.hpp>
-#include <boost/fusion/adapted/mpl/mpl_iterator.hpp>
 
 namespace boost { namespace fusion
 {
@@ -73,7 +72,7 @@
           : sequence_base<segmented_view<Tag, Cons1, Cons2> >
         {
             typedef segmented_view_tag<Tag> fusion_tag;
- typedef fusion_sequence_tag tag; // this gets picked up by MPL
+ typedef fusion_sequence_tag tag;
             typedef mpl::true_ is_view;
             typedef forward_traversal_tag category;
 
@@ -92,7 +91,7 @@
           : sequence_base<segmented_view<center_view, Cons1, Cons2> >
         {
             typedef segmented_view_tag<center_view> fusion_tag;
- typedef fusion_sequence_tag tag; // this gets picked up by MPL
+ typedef fusion_sequence_tag tag;
             typedef mpl::true_ is_view;
             typedef forward_traversal_tag category;
 
@@ -149,8 +148,8 @@
             template<typename Sig>
             struct result;
 
- template<typename This, typename First, typename Second>
- struct result<This(First, Second)>
+ template<typename Self, typename First, typename Second>
+ struct result<Self(First, Second)>
               : result_<
                     typename remove_cv<typename remove_reference<First>::type>::type
                   , typename remove_cv<typename remove_reference<Second>::type>::type
@@ -210,7 +209,7 @@
                 typedef detail::segments_transform<Cdr> tfx;
                 typedef joint_view<
                     single_view<detail::right_view> const
- , multiple_view<size_minus_1, detail::full_view> const
+ , repetitive_view<single_view<detail::full_view>, size_minus_1::value> const
> mask;
                 typedef transform_view<mask const, segmented_range const, tfx> type;
 
@@ -219,7 +218,7 @@
                     return type(
                         mask(
                             make_single_view(detail::right_view())
- , make_multiple_view<size_minus_1>(detail::full_view())
+ , repeat<size_minus_1::value>(make_single_view(detail::full_view()))
                         )
                       , seq.cons.car
                       , tfx(seq.cons.cdr)
@@ -265,9 +264,8 @@
 
                 typedef detail::segments_transform<Cdr> tfx;
                 typedef typename result_of::size<segmented_range>::type size;
- typedef typename mpl::prior<size>::type size_minus_1;
                 typedef joint_view<
- multiple_view<size_minus_1, detail::full_view> const
+ repetitive_view<detail::full_view, size::value-1> const
                   , single_view<detail::left_view> const
> mask;
                 typedef transform_view<mask const, segmented_range const, tfx> type;
@@ -276,7 +274,7 @@
                 {
                     return type(
                         mask(
- make_multiple_view<size_minus_1>(detail::full_view())
+ repeat<size::value-1>(detail::full_view())
                           , make_single_view(detail::left_view())
                         )
                       , segmented_range(fusion::begin(seq.cons.car.sequence), fusion::next(seq.cons.car.where_))
@@ -332,7 +330,7 @@
> tfx;
 
                 typedef joint_view<
- multiple_view<size_minus_2, detail::full_view> const
+ repetitive_view<single_view<detail::full_view>,size_minus_2::value> const
                   , single_view<detail::left_view> const
> left_mask;
 
@@ -346,7 +344,7 @@
                 static type call(Sequence &seq)
                 {
                     left_mask lmask(
- make_multiple_view<size_minus_2>(detail::full_view())
+ repeat<size_minus_2>(detail::full_view())
                       , make_single_view(detail::left_view())
                     );
                     return type(
@@ -368,19 +366,19 @@
     struct iterator_range<segmented_iterator<First>, segmented_iterator<Last> >
       : sequence_base<iterator_range<segmented_iterator<First>, segmented_iterator<Last> > >
     {
- typedef typename convert_iterator<segmented_iterator<First> >::type begin_type;
- typedef typename convert_iterator<segmented_iterator<Last> >::type end_type;
+ typedef segmented_iterator<First> begin_type;
+ typedef segmented_iterator<Last> end_type;
         typedef typename detail::reverse_cons<First>::type begin_cons_type;
         typedef typename detail::reverse_cons<Last>::type end_cons_type;
         typedef iterator_range_tag fusion_tag;
- typedef fusion_sequence_tag tag; // this gets picked up by MPL
+ typedef fusion_sequence_tag tag;
         typedef typename traits::category_of<begin_type>::type category;
         typedef typename result_of::distance<begin_type, end_type>::type size;
         typedef mpl::true_ is_view;
 
         iterator_range(segmented_iterator<First> const& first_, segmented_iterator<Last> const& last_)
- : first(convert_iterator<segmented_iterator<First> >::call(first_))
- , last(convert_iterator<segmented_iterator<Last> >::call(last_))
+ : first(first_)
+ , last(last_)
           , first_cons(detail::reverse_cons<First>::call(first_.cons()))
           , last_cons(detail::reverse_cons<Last>::call(last_.cons()))
         {}

Modified: sandbox/SOC/2009/fusion/libs/fusion/test/Jamfile
==============================================================================
--- sandbox/SOC/2009/fusion/libs/fusion/test/Jamfile (original)
+++ sandbox/SOC/2009/fusion/libs/fusion/test/Jamfile 2010-01-24 08:35:20 EST (Sun, 24 Jan 2010)
@@ -96,9 +96,9 @@
     [ run sequence/zip_view_ignore.cpp : : : : ]
     [ run sequence/repetitive_view.cpp : : : : ]
     [ run sequence/deduce_sequence.cpp : : : : ]
+ [ run sequence/adapt_class.cpp : : : : ]
     [ run sequence/adapt_struct.cpp : : : : ]
     [ run sequence/adapt_assoc_struct.cpp : : : : ]
- [ run sequence/swap.cpp : : : : ]
 
     [ run functional/fused.cpp : : : : ]
     [ run functional/fused_function_object.cpp : : : : ]
@@ -112,6 +112,11 @@
     [ run functional/invoke.cpp : : : : ]
     [ run functional/invoke_function_object.cpp : : : : ]
     [ run functional/invoke_procedure.cpp : : : : ]
+ [ run sequence/swap.cpp : : : : ]
+
+# [ run algorithm/ext_/for_each_s.cpp : : : : ]
+# [ run algorithm/ext_/find_if_s.cpp : : : : ]
+# [ run sequence/ext_/iterator_range_s.cpp : : : : ]
 
 # [ compile-fail xxx.cpp : : : : ]
 

Added: sandbox/SOC/2009/fusion/libs/fusion/test/sequence/adapt_class.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/fusion/libs/fusion/test/sequence/adapt_class.cpp 2010-01-24 08:35:20 EST (Sun, 24 Jan 2010)
@@ -0,0 +1,129 @@
+/*=============================================================================
+ Copyright (c) 2001-2009 Joel de Guzman
+
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+==============================================================================*/
+#include <boost/detail/lightweight_test.hpp>
+#include <boost/fusion/adapted/class/adapt_class.hpp>
+#include <boost/fusion/sequence/intrinsic/at.hpp>
+#include <boost/fusion/sequence/intrinsic/size.hpp>
+#include <boost/fusion/sequence/intrinsic/empty.hpp>
+#include <boost/fusion/sequence/intrinsic/front.hpp>
+#include <boost/fusion/sequence/intrinsic/back.hpp>
+#include <boost/fusion/sequence/intrinsic/value_at.hpp>
+#include <boost/fusion/sequence/io/out.hpp>
+#include <boost/fusion/container/vector/vector.hpp>
+#include <boost/fusion/container/list/list.hpp>
+#include <boost/fusion/container/generation/make_vector.hpp>
+#include <boost/fusion/container/vector/convert.hpp>
+#include <boost/fusion/sequence/comparison/equal_to.hpp>
+#include <boost/fusion/sequence/comparison/not_equal_to.hpp>
+#include <boost/fusion/sequence/comparison/less.hpp>
+#include <boost/fusion/sequence/comparison/less_equal.hpp>
+#include <boost/fusion/sequence/comparison/greater.hpp>
+#include <boost/fusion/sequence/comparison/greater_equal.hpp>
+#include <boost/fusion/mpl.hpp>
+#include <boost/fusion/support/is_view.hpp>
+#include <boost/mpl/front.hpp>
+#include <boost/mpl/is_sequence.hpp>
+#include <boost/mpl/assert.hpp>
+#include <boost/static_assert.hpp>
+#include <iostream>
+#include <string>
+
+namespace ns
+{
+ class point
+ {
+ public:
+
+ point() : x(0), y(0) {}
+ point(int x, int y) : x(x), y(y) {}
+
+ int get_x() const { return x; }
+ int get_y() const { return y; }
+ void set_x(int x_) { x = x_; }
+ void set_y(int y_) { y = y_; }
+
+ private:
+
+ int x;
+ int y;
+ };
+}
+
+BOOST_FUSION_ADAPT_CLASS(
+ ns::point,
+ (int, int, obj.get_x(), obj.set_x(val))
+ (int, int, obj.get_y(), obj.set_y(val))
+)
+
+int
+main()
+{
+ using namespace boost::fusion;
+ using namespace std;
+
+ std::cout << tuple_open('[');
+ std::cout << tuple_close(']');
+ std::cout << tuple_delimiter(", ");
+
+ {
+ BOOST_MPL_ASSERT_NOT((traits::is_view<ns::point>));
+ ns::point p(123, 456);
+
+ std::cout << at_c<0>(p) << std::endl;
+ std::cout << at_c<1>(p) << std::endl;
+ std::cout << p << std::endl;
+ BOOST_TEST(p == make_vector(123, 456));
+
+ at_c<0>(p) = 6;
+ at_c<1>(p) = 9;
+ BOOST_TEST(p == make_vector(6, 9));
+
+ BOOST_STATIC_ASSERT(result_of::size<ns::point>::value == 2);
+ BOOST_STATIC_ASSERT(!result_of::empty<ns::point>::value);
+
+ BOOST_TEST(front(p) == 6);
+ BOOST_TEST(back(p) == 9);
+ }
+
+ {
+ boost::fusion::vector<int, float> v1(4, 2);
+ ns::point v2(5, 3);
+ boost::fusion::vector<long, double> v3(5, 4);
+ BOOST_TEST(v1 < v2);
+ BOOST_TEST(v1 <= v2);
+ BOOST_TEST(v2 > v1);
+ BOOST_TEST(v2 >= v1);
+ BOOST_TEST(v2 < v3);
+ BOOST_TEST(v2 <= v3);
+ BOOST_TEST(v3 > v2);
+ BOOST_TEST(v3 >= v2);
+ }
+
+ {
+ // conversion from ns::point to vector
+ ns::point p(5, 3);
+ boost::fusion::vector<int, short> v(p);
+ v = p;
+ }
+
+ {
+ // conversion from ns::point to list
+ ns::point p(5, 3);
+ boost::fusion::list<int, short> l(p);
+ l = p;
+ }
+
+ {
+ BOOST_MPL_ASSERT((boost::mpl::is_sequence<ns::point>));
+ BOOST_MPL_ASSERT((boost::is_same<
+ boost::fusion::result_of::value_at_c<ns::point,0>::type
+ , boost::mpl::front<ns::point>::type>));
+ }
+
+ return boost::report_errors();
+}
+


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