Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r62915 - in sandbox/SOC/2009/fusion: boost/fusion/adapted/detail/struct boost/fusion/adapted/struct boost/fusion/algorithm boost/fusion/algorithm/iteration boost/fusion/algorithm/iteration/detail boost/fusion/algorithm/transformation boost/fusion/container/detail boost/fusion/container/detail/pp boost/fusion/container/detail/variadic_templates boost/fusion/container/list boost/fusion/container/list/detail/pp boost/fusion/container/vector/detail/pp boost/fusion/container/vector/detail/variadic_templates boost/fusion/include boost/fusion/support boost/fusion/support/internal boost/fusion/view/ext_ boost/fusion/view/filter_view boost/fusion/view/filter_view/detail boost/fusion/view/iterator_range boost/fusion/view/joint_view boost/fusion/view/single_view boost/fusion/view/transform_view boost/fusion/view/zip_view boost/proto boost/proto/transform libs/fusion/test/suite1/sequence
From: mr.chr.schmidt_at_[hidden]
Date: 2010-06-13 12:50:11


Author: cschmidt
Date: 2010-06-13 12:50:06 EDT (Sun, 13 Jun 2010)
New Revision: 62915
URL: http://svn.boost.org/trac/boost/changeset/62915

Log:
added reverse_fold, iter_fold and reverse_iter_fold
Added:
   sandbox/SOC/2009/fusion/boost/fusion/algorithm/iteration/iter_fold.hpp (contents, props changed)
   sandbox/SOC/2009/fusion/boost/fusion/algorithm/iteration/reverse_fold.hpp (contents, props changed)
   sandbox/SOC/2009/fusion/boost/fusion/algorithm/iteration/reverse_iter_fold.hpp (contents, props changed)
   sandbox/SOC/2009/fusion/boost/fusion/include/iter_fold.hpp (contents, props changed)
   sandbox/SOC/2009/fusion/boost/fusion/include/reverse_fold.hpp (contents, props changed)
   sandbox/SOC/2009/fusion/boost/fusion/include/reverse_iter_fold.hpp (contents, props changed)
Text files modified:
   sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/struct/adapt_base.hpp | 4
   sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/struct/define_struct.hpp | 7
   sandbox/SOC/2009/fusion/boost/fusion/adapted/struct/adapt_assoc_struct.hpp | 9
   sandbox/SOC/2009/fusion/boost/fusion/adapted/struct/adapt_struct.hpp | 3
   sandbox/SOC/2009/fusion/boost/fusion/algorithm/iteration.hpp | 3
   sandbox/SOC/2009/fusion/boost/fusion/algorithm/iteration/detail/fold.hpp | 577 ++++++++++++++++++++++++++-------------
   sandbox/SOC/2009/fusion/boost/fusion/algorithm/iteration/fold.hpp | 68 ----
   sandbox/SOC/2009/fusion/boost/fusion/algorithm/transformation/filter_if.hpp | 55 +++
   sandbox/SOC/2009/fusion/boost/fusion/container/detail/forward_interface.hpp | 20
   sandbox/SOC/2009/fusion/boost/fusion/container/detail/pp/forward_interface_n.hpp | 9
   sandbox/SOC/2009/fusion/boost/fusion/container/detail/variadic_templates/forward_interface.hpp | 1
   sandbox/SOC/2009/fusion/boost/fusion/container/list/detail/pp/list_forward_ctor_n.hpp | 12
   sandbox/SOC/2009/fusion/boost/fusion/container/list/list.hpp | 5
   sandbox/SOC/2009/fusion/boost/fusion/container/vector/detail/pp/vector_n.hpp | 2
   sandbox/SOC/2009/fusion/boost/fusion/container/vector/detail/variadic_templates/vector_n.hpp | 28 +
   sandbox/SOC/2009/fusion/boost/fusion/support/internal/is_explicitly_convertible.hpp | 14
   sandbox/SOC/2009/fusion/boost/fusion/support/internal/workaround.hpp | 12
   sandbox/SOC/2009/fusion/boost/fusion/support/sequence_base.hpp | 10
   sandbox/SOC/2009/fusion/boost/fusion/view/ext_/segmented_iterator.hpp | 19 +
   sandbox/SOC/2009/fusion/boost/fusion/view/filter_view/detail/begin_impl.hpp | 4
   sandbox/SOC/2009/fusion/boost/fusion/view/filter_view/detail/deref_data_impl.hpp | 1
   sandbox/SOC/2009/fusion/boost/fusion/view/filter_view/detail/deref_impl.hpp | 1
   sandbox/SOC/2009/fusion/boost/fusion/view/filter_view/detail/end_impl.hpp | 4
   sandbox/SOC/2009/fusion/boost/fusion/view/filter_view/detail/equal_to_impl.hpp | 1
   sandbox/SOC/2009/fusion/boost/fusion/view/filter_view/detail/filter_view_iterator.hpp | 31 +
   sandbox/SOC/2009/fusion/boost/fusion/view/filter_view/detail/key_of_impl.hpp | 1
   sandbox/SOC/2009/fusion/boost/fusion/view/filter_view/detail/next_impl.hpp | 21 -
   sandbox/SOC/2009/fusion/boost/fusion/view/filter_view/detail/size_impl.hpp | 1
   sandbox/SOC/2009/fusion/boost/fusion/view/filter_view/detail/value_of_data_impl.hpp | 1
   sandbox/SOC/2009/fusion/boost/fusion/view/filter_view/detail/value_of_impl.hpp | 1
   sandbox/SOC/2009/fusion/boost/fusion/view/filter_view/filter_view.hpp | 18
   sandbox/SOC/2009/fusion/boost/fusion/view/iterator_range/iterator_range.hpp | 1
   sandbox/SOC/2009/fusion/boost/fusion/view/joint_view/joint_view.hpp | 2
   sandbox/SOC/2009/fusion/boost/fusion/view/single_view/single_view.hpp | 27 -
   sandbox/SOC/2009/fusion/boost/fusion/view/transform_view/transform_view.hpp | 10
   sandbox/SOC/2009/fusion/boost/fusion/view/zip_view/zip_view.hpp | 1
   sandbox/SOC/2009/fusion/boost/proto/fusion.hpp | 109 +++----
   sandbox/SOC/2009/fusion/boost/proto/transform/fold.hpp | 2
   sandbox/SOC/2009/fusion/libs/fusion/test/suite1/sequence/filter_view.cpp | 26
   39 files changed, 674 insertions(+), 447 deletions(-)

Modified: sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/struct/adapt_base.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/struct/adapt_base.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/struct/adapt_base.hpp 2010-06-13 12:50:06 EDT (Sun, 13 Jun 2010)
@@ -84,7 +84,7 @@
         ATTRIBUTE)
 
 #define BOOST_FUSION_ADAPT_STRUCT_C_BASE( \
- TEMPLATE_PARAMS_SEQ,NAME_SEQ,I,PREFIX,ATTRIBUTE,ATTRIBUTE_TUPEL_SIZE) \
+ TEMPLATE_PARAMS_SEQ, NAME_SEQ, I, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE) \
                                                                                 \
     template< \
         BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(TEMPLATE_PARAMS_SEQ) \
@@ -106,7 +106,7 @@
             static type \
             call(SeqRef seq) \
             { \
- return seq.PREFIX \
+ return seq. \
                     BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 1, ATTRIBUTE); \
             } \
         }; \

Modified: sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/struct/define_struct.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/struct/define_struct.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/struct/define_struct.hpp 2010-06-13 12:50:06 EDT (Sun, 13 Jun 2010)
@@ -22,6 +22,7 @@
 #include <boost/fusion/support/internal/constexpr.hpp>
 #include <boost/preprocessor/inc.hpp>
 #include <boost/preprocessor/if.hpp>
+#include <boost/preprocessor/expr_if.hpp>
 #include <boost/preprocessor/dec.hpp>
 #include <boost/preprocessor/logical/not.hpp>
 #include <boost/preprocessor/punctuation/comma_if.hpp>
@@ -64,7 +65,7 @@
 #define BOOST_FUSION_DEFINE_STRUCT_ASSIGN_FILLER_I( \
     R, ATTRIBUTE_TUPEL_SIZE, I_, ATTRIBUTE) \
                                                                                 \
- BOOST_PP_IF( \
+ BOOST_PP_EXPR_IF( \
         I_, \
         typedef typename \
             boost::fusion::result_of::next< \
@@ -72,9 +73,7 @@
>::type \
         BOOST_PP_CAT(I,I_); \
         BOOST_PP_CAT(I,I_) BOOST_PP_CAT(i,I_)= \
- boost::fusion::next(BOOST_PP_CAT(i,BOOST_PP_DEC(I_)));, \
- BOOST_PP_EMPTY() \
- ) \
+ boost::fusion::next(BOOST_PP_CAT(i,BOOST_PP_DEC(I_)));) \
                                                                                 \
     BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE,1,ATTRIBUTE)= \
         boost::fusion::deref(BOOST_PP_CAT(i,I_));

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-06-13 12:50:06 EDT (Sun, 13 Jun 2010)
@@ -12,7 +12,6 @@
 
 #include <boost/fusion/support/internal/ref.hpp>
 #include <boost/preprocessor/cat.hpp>
-#include <boost/preprocessor/empty.hpp>
 #include <boost/preprocessor/tuple/elem.hpp>
 
 #include <boost/fusion/adapted/detail/struct/extension.hpp>
@@ -39,10 +38,10 @@
 #define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_1_END
 
 #define BOOST_FUSION_ADAPT_ASSOC_STRUCT_C_BASE( \
- TEMPLATE_PARAMS_SEQ,NAME_SEQ,I,PREFIX,ATTRIBUTE) \
+ TEMPLATE_PARAMS_SEQ, NAME_SEQ, I, ATTRIBUTE) \
                                                                                 \
     BOOST_FUSION_ADAPT_STRUCT_C_BASE( \
- TEMPLATE_PARAMS_SEQ, NAME_SEQ, I, PREFIX, ATTRIBUTE, 3) \
+ TEMPLATE_PARAMS_SEQ, NAME_SEQ, I, ATTRIBUTE, 3) \
                                                                                 \
     template< \
         BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(TEMPLATE_PARAMS_SEQ) \
@@ -53,10 +52,10 @@
     };
 
 #define BOOST_FUSION_ADAPT_ASSOC_STRUCT_C( \
- TEMPLATE_PARAMS_SEQ,NAME_SEQ, I, ATTRIBUTE) \
+ TEMPLATE_PARAMS_SEQ, NAME_SEQ, I, ATTRIBUTE) \
                                                                                 \
     BOOST_FUSION_ADAPT_ASSOC_STRUCT_C_BASE( \
- TEMPLATE_PARAMS_SEQ,NAME_SEQ,I,BOOST_PP_EMPTY(),ATTRIBUTE)
+ TEMPLATE_PARAMS_SEQ, NAME_SEQ, I, ATTRIBUTE)
 
 #define BOOST_FUSION_ADAPT_ASSOC_TPL_STRUCT( \
     TEMPLATE_PARAMS_SEQ, NAME_SEQ, ATTRIBUTES) \

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-06-13 12:50:06 EDT (Sun, 13 Jun 2010)
@@ -11,7 +11,6 @@
 
 #include <boost/fusion/support/internal/ref.hpp>
 #include <boost/preprocessor/cat.hpp>
-#include <boost/preprocessor/empty.hpp>
 
 #include <boost/fusion/adapted/detail/struct/extension.hpp>
 #include <boost/fusion/adapted/detail/struct/adapt_base.hpp>
@@ -35,7 +34,7 @@
 
 #define BOOST_FUSION_ADAPT_STRUCT_C(TEMPLATE_PARAMS_SEQ, NAME_SEQ, I, ATTRIBUTE)\
     BOOST_FUSION_ADAPT_STRUCT_C_BASE( \
- TEMPLATE_PARAMS_SEQ,NAME_SEQ,I,BOOST_PP_EMPTY(),ATTRIBUTE,2)
+ TEMPLATE_PARAMS_SEQ, NAME_SEQ, I, ATTRIBUTE, 2)
 
 #define BOOST_FUSION_ADAPT_TPL_STRUCT(TEMPLATE_PARAMS_SEQ,NAME_SEQ, ATTRIBUTES) \
     BOOST_FUSION_ADAPT_STRUCT_BASE( \

Modified: sandbox/SOC/2009/fusion/boost/fusion/algorithm/iteration.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/algorithm/iteration.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/algorithm/iteration.hpp 2010-06-13 12:50:06 EDT (Sun, 13 Jun 2010)
@@ -11,5 +11,8 @@
 #include <boost/fusion/algorithm/iteration/accumulate.hpp>
 #include <boost/fusion/algorithm/iteration/fold.hpp>
 #include <boost/fusion/algorithm/iteration/for_each.hpp>
+#include <boost/fusion/algorithm/iteration/iter_fold.hpp>
+#include <boost/fusion/algorithm/iteration/reverse_fold.hpp>
+#include <boost/fusion/algorithm/iteration/reverse_iter_fold.hpp>
 
 #endif

Modified: sandbox/SOC/2009/fusion/boost/fusion/algorithm/iteration/detail/fold.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/algorithm/iteration/detail/fold.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/algorithm/iteration/detail/fold.hpp 2010-06-13 12:50:06 EDT (Sun, 13 Jun 2010)
@@ -1,7 +1,7 @@
 /*=============================================================================
     Copyright (c) 2001-2006 Joel de Guzman
     Copyright (c) 2006 Dan Marsden
- Copyright (c) 2009 Christopher Schmidt
+ Copyright (c) 2009-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)
@@ -10,6 +10,7 @@
 #ifndef BOOST_FUSION_ALGORITHM_ITERATION_DETAIL_FOLD_HPP
 #define BOOST_FUSION_ALGORITHM_ITERATION_DETAIL_FOLD_HPP
 
+#include <boost/config.hpp>
 #include <boost/fusion/sequence/intrinsic/begin.hpp>
 #include <boost/fusion/sequence/intrinsic/end.hpp>
 #include <boost/fusion/sequence/intrinsic/empty.hpp>
@@ -17,9 +18,12 @@
 #include <boost/fusion/iterator/equal_to.hpp>
 #include <boost/fusion/iterator/deref.hpp>
 #include <boost/fusion/iterator/value_of.hpp>
+#include <boost/fusion/iterator/prior.hpp>
 #include <boost/fusion/iterator/next.hpp>
 #include <boost/fusion/support/internal/result_of.hpp>
-
+#include <boost/fusion/support/internal/ref.hpp>
+#include <boost/fusion/support/internal/assert.hpp>
+#include <boost/preprocessor/cat.hpp>
 #include <boost/mpl/eval_if.hpp>
 #include <boost/mpl/if.hpp>
 #include <boost/mpl/bool.hpp>
@@ -27,25 +31,91 @@
 # include <boost/type_traits/add_const.hpp>
 #endif
 
-namespace boost { namespace fusion { namespace detail
+#endif
+
+#ifdef BOOST_FUSION_REVERSE_FOLD
+# ifdef BOOST_FUSION_ITER_FOLD
+# define BOOST_FUSION_FOLD_NAME reverse_iter_fold
+# else
+# define BOOST_FUSION_FOLD_NAME reverse_fold
+# endif
+
+# define BOOST_FUSION_FOLD_IMPL_FIRST_IT_FUNCTION end
+# define BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION prior
+# define BOOST_FUSION_FOLD_IMPL_FIRST_IT_META_TRANSFORM(IT) \
+ typename fusion::result_of::prior<IT>::type
+# define BOOST_FUSION_FOLD_IMPL_FIRST_IT_TRANSFORM(IT) fusion::prior(IT)
+#else
+# ifdef BOOST_FUSION_ITER_FOLD
+# define BOOST_FUSION_FOLD_NAME iter_fold
+# else
+# define BOOST_FUSION_FOLD_NAME fold
+# endif
+
+# define BOOST_FUSION_FOLD_IMPL_FIRST_IT_FUNCTION begin
+# define BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION next
+# define BOOST_FUSION_FOLD_IMPL_FIRST_IT_META_TRANSFORM(IT) IT
+# define BOOST_FUSION_FOLD_IMPL_FIRST_IT_TRANSFORM(IT) IT
+#endif
+#ifdef BOOST_FUSION_ITER_FOLD
+# define BOOST_FUSION_FOLD_IMPL_INVOKE_IT_META_TRANSFORM(IT) IT
+# define BOOST_FUSION_FOLD_IMPL_INVOKE_IT_TRANSFORM(IT) IT
+#else
+# define BOOST_FUSION_FOLD_IMPL_INVOKE_IT_META_TRANSFORM(IT) \
+ typename fusion::result_of::deref<IT>::type
+# define BOOST_FUSION_FOLD_IMPL_INVOKE_IT_TRANSFORM(IT) fusion::deref(IT)
+#endif
+
+
+namespace boost { namespace fusion
 {
- template<typename Result,int N>
- struct unrolled_fold
+ namespace detail
     {
- template<typename State, typename It0, typename F>
- static Result
- call(BOOST_FUSION_R_ELSE_CLREF(State) state,
- It0 const& it0,
- BOOST_FUSION_RREF_ELSE_OBJ(F) f)
- {
- typedef typename result_of::next<It0 const&>::type It1;
- It1 it1 = fusion::next(it0);
- typedef typename result_of::next<It1&>::type It2;
- It2 it2 = fusion::next(it1);
- typedef typename result_of::next<It2&>::type It3;
- It3 it3 = fusion::next(it2);
+ template<typename State, typename It, typename F>
+ struct BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME, _rvalue_state)
+ : boost::result_of<
+ F(
+#ifdef BOOST_NO_RVALUE_REFERENCES
+ typename add_lref<typename add_const<State>::type>::type
+#else
+ State&&
+#endif
+ , BOOST_FUSION_FOLD_IMPL_INVOKE_IT_META_TRANSFORM(It))
+ >
+ {};
 
- return unrolled_fold<Result,N-4>::call(
+ template<typename Result,int N>
+ struct BOOST_PP_CAT(unrolled_,BOOST_FUSION_FOLD_NAME)
+ {
+ template<typename State, typename It0, typename F>
+ static Result
+ call(BOOST_FUSION_R_ELSE_CLREF(State) state,
+ It0 const& it0,
+ BOOST_FUSION_RREF_ELSE_OBJ(F) f)
+ {
+ typedef typename
+ result_of::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION<
+ It0 const&
+ >::type
+ It1;
+ It1 it1 = fusion::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION(it0);
+ typedef typename
+ result_of::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION<
+ It1&
+ >::type
+ It2;
+ It2 it2 = fusion::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION(it1);
+ typedef typename
+ result_of::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION<
+ It2&
+ >::type
+ It3;
+ It3 it3 = fusion::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION(it2);
+
+ return BOOST_PP_CAT(unrolled_,BOOST_FUSION_FOLD_NAME)<
+ Result
+ , N-4
+ >::call(
                     f(
                         f(
                             f(
@@ -61,24 +131,32 @@
                     ),
                     fusion::next(it3),
                     BOOST_FUSION_FORWARD(F,f));
- }
- };
+ }
+ };
 
- template<typename Result>
- struct unrolled_fold<Result,3>
- {
- template<typename State, typename It0, typename F>
- static Result
- call(BOOST_FUSION_R_ELSE_CLREF(State) state,
- It0 const& it0,
- BOOST_FUSION_RREF_ELSE_OBJ(F) f)
+ template<typename Result>
+ struct BOOST_PP_CAT(unrolled_,BOOST_FUSION_FOLD_NAME)<Result,3>
         {
- typedef typename result_of::next<It0 const&>::type It1;
- It1 it1 = fusion::next(it0);
- typedef typename result_of::next<It1&>::type It2;
- It2 it2 = fusion::next(it1);
+ template<typename State, typename It0, typename F>
+ static Result
+ call(BOOST_FUSION_R_ELSE_CLREF(State) state,
+ It0 const& it0,
+ BOOST_FUSION_RREF_ELSE_OBJ(F) f)
+ {
+ typedef typename
+ result_of::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION<
+ It0 const&
+ >::type
+ It1;
+ It1 it1 = fusion::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION(it0);
+ typedef typename
+ result_of::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION<
+ It1&
+ >::type
+ It2;
+ It2 it2 = fusion::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION(it1);
 
- return f(
+ return f(
                         f(
                             f(
                                 BOOST_FUSION_FORWARD(State,state),
@@ -86,192 +164,313 @@
                             ),
                             fusion::deref(it1)
                         ),
- fusion::deref(fusion::next(it1))
- );
- }
- };
+ fusion::deref(
+ fusion::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION(it1)
+ ));
+ }
+ };
 
- template<typename Result>
- struct unrolled_fold<Result,2>
- {
- template<typename State, typename It0, typename F>
- static Result
- call(BOOST_FUSION_R_ELSE_CLREF(State) state,
- It0 const& it0,
- BOOST_FUSION_RREF_ELSE_OBJ(F) f)
+ template<typename Result>
+ struct BOOST_PP_CAT(unrolled_,BOOST_FUSION_FOLD_NAME)<Result,2>
         {
- return f(
+ template<typename State, typename It0, typename F>
+ static Result
+ call(BOOST_FUSION_R_ELSE_CLREF(State) state,
+ It0 const& it0,
+ BOOST_FUSION_RREF_ELSE_OBJ(F) f)
+ {
+ return f(
                     f(BOOST_FUSION_FORWARD(State,state),fusion::deref(it0)),
- fusion::deref(fusion::next(it0)));
- }
- };
+ fusion::deref(
+ fusion::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION(it0)));
+ }
+ };
 
- template<typename Result>
- struct unrolled_fold<Result,1>
- {
- template<typename State, typename It0, typename F>
- static Result
- call(BOOST_FUSION_R_ELSE_CLREF(State) state,
+ template<typename Result>
+ struct BOOST_PP_CAT(unrolled_,BOOST_FUSION_FOLD_NAME)<Result,1>
+ {
+ template<typename State, typename It0, typename F>
+ static Result
+ call(BOOST_FUSION_R_ELSE_CLREF(State) state,
                 It0 const& it0,
                 BOOST_FUSION_RREF_ELSE_OBJ(F) f)
- {
- return f(BOOST_FUSION_FORWARD(State,state),fusion::deref(it0));
- }
- };
+ {
+ return f(BOOST_FUSION_FORWARD(State,state),fusion::deref(it0));
+ }
+ };
 
- template<typename Result>
- struct unrolled_fold<Result,0>
- {
- template<typename State, typename It0, typename F>
- static Result
- call(BOOST_FUSION_R_ELSE_CLREF(State) state,
+ template<typename Result>
+ struct BOOST_PP_CAT(unrolled_,BOOST_FUSION_FOLD_NAME)<Result,0>
+ {
+ template<typename State, typename It0, typename F>
+ static Result
+ call(BOOST_FUSION_R_ELSE_CLREF(State) state,
                 It0 const&,
                 BOOST_FUSION_RREF_ELSE_OBJ(F))
+ {
+ return state;
+ }
+ };
+
+ template<typename StateRef, typename It0, typename F, int N>
+ struct BOOST_PP_CAT(result_of_unrolled_,BOOST_FUSION_FOLD_NAME)
         {
- return state;
- }
- };
-
- template<typename StateRef, typename It, typename F>
- struct fold_apply
- : boost::result_of<
- F(
- StateRef,
-#ifdef BOOST_NO_RVALUE_REFERENCES
- typename add_lref<
- typename add_const<
- typename result_of::deref<It>::type
+ typedef typename
+ BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME, _rvalue_state)<
+ StateRef
+ , It0
+ , F
>::type
- >::type
-#else
- typename result_of::deref<It>::type&&
-#endif
- )
- >
- {};
+ rest1;
+ typedef typename
+ result_of::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION<It0>::type
+ it1;
+ typedef typename
+ BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME, _rvalue_state)<
+ rest1
+ , it1
+ , F
+ >::type
+ rest2;
+ typedef typename
+ result_of::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION<it1>::type
+ it2;
+ typedef typename
+ BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME, _rvalue_state)<
+ rest2
+ , it2
+ , F
+ >::type
+ rest3;
+ typedef typename
+ result_of::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION<it2>::type
+ it3;
+
+ typedef typename
+ BOOST_PP_CAT(result_of_unrolled_,BOOST_FUSION_FOLD_NAME)<
+ typename BOOST_PP_CAT(
+ BOOST_FUSION_FOLD_NAME, _rvalue_state)<
+ rest3
+ , it3
+ , F
+ >::type
+ , typename result_of::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION<
+ it3
+ >::type
+ , F
+ , N-4
+ >::type
+ type;
+ };
 
- template<typename State, typename It, typename F>
- struct fold_apply_rvalue_state
- : fold_apply<
-#ifdef BOOST_NO_RVALUE_REFERENCES
- typename add_lref<typename add_const<State>::type>::type
-#else
- State&&
-#endif
- , It
+ template<typename StateRef, typename It0, typename F>
+ struct BOOST_PP_CAT(result_of_unrolled_,BOOST_FUSION_FOLD_NAME)<
+ StateRef
+ , It0
           , F
+ , 3
>
- {};
+ {
+ typedef typename
+ BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME, _rvalue_state)<
+ StateRef
+ , It0
+ , F
+ >::type
+ rest1;
+ typedef typename
+ result_of::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION<It0>::type
+ it1;
+
+ typedef typename
+ BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME, _rvalue_state)<
+ typename BOOST_PP_CAT(
+ BOOST_FUSION_FOLD_NAME, _rvalue_state)<
+ rest1
+ , it1
+ , F
+ >::type
+ , typename result_of::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION<
+ it1
+ >::type
+ , F
+ >::type
+ type;
+ };
 
- template<typename StateRef, typename It0, typename F, int N>
- struct result_of_unrolled_fold
- {
- typedef typename fold_apply_rvalue_state<StateRef, It0, F>::type rest1;
- typedef typename result_of::next<It0>::type it1;
- typedef typename fold_apply_rvalue_state<rest1, it1, F>::type rest2;
- typedef typename result_of::next<it1>::type it2;
- typedef typename fold_apply_rvalue_state<rest2, it2, F>::type rest3;
- typedef typename result_of::next<it2>::type it3;
-
- typedef typename
- result_of_unrolled_fold<
- typename fold_apply_rvalue_state<rest3, it3, F>::type
- , typename result_of::next<it3>::type
+ template<typename StateRef, typename It0, typename F>
+ struct BOOST_PP_CAT(result_of_unrolled_,BOOST_FUSION_FOLD_NAME)<
+ StateRef
+ , It0
+ , F
+ , 2
+ >
+ : BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME, _rvalue_state)<
+ typename BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME, _rvalue_state)<
+ StateRef
+ , It0
+ , F
+ >::type
+ , typename result_of::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION<
+ It0
+ >::type
               , F
- , N-4
- >::type
- type;
- };
+ >
+ {};
 
- template<typename StateRef, typename It0, typename F>
- struct result_of_unrolled_fold<StateRef, It0, F, 3>
- {
- typedef typename fold_apply_rvalue_state<StateRef, It0, F>::type rest1;
- typedef typename result_of::next<It0>::type it1;
-
- typedef typename
- fold_apply_rvalue_state<
- typename fold_apply_rvalue_state<rest1, it1, F>::type
- , typename result_of::next<it1>::type
- , F
- >::type
- type;
- };
-
- template<typename StateRef, typename It0, typename F>
- struct result_of_unrolled_fold<StateRef, It0, F, 2>
- : fold_apply_rvalue_state<
- typename fold_apply_rvalue_state<StateRef, It0, F>::type
- , typename result_of::next<It0>::type
+ template<typename StateRef, typename It0, typename F>
+ struct BOOST_PP_CAT(result_of_unrolled_,BOOST_FUSION_FOLD_NAME)<
+ StateRef
+ , It0
           , F
+ , 1
>
- {};
+ : BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME, _rvalue_state)<
+ StateRef
+ , It0
+ , F
+ >
+ {};
 
- template<typename StateRef, typename It0, typename F>
- struct result_of_unrolled_fold<StateRef, It0, F, 1>
- : fold_apply_rvalue_state<StateRef, It0, F>
- {};
+ template<typename StateRef, typename It0, typename F>
+ struct BOOST_PP_CAT(result_of_unrolled_,BOOST_FUSION_FOLD_NAME)<
+ StateRef
+ , It0
+ , F
+ , 0
+ >
+ {
+ typedef StateRef type;
+ };
 
- template<typename StateRef, typename It0, typename F>
- struct result_of_unrolled_fold<StateRef, It0, F, 0>
- {
- typedef StateRef type;
- };
+ template<typename StateRef, typename It0, typename F, int SeqSize>
+ struct BOOST_PP_CAT(result_of_first_unrolled,BOOST_FUSION_FOLD_NAME)
+ {
+ typedef typename get_func_base<F>::type f;
 
- template<typename StateRef, typename It0, typename F, int SeqSize>
- struct result_of_unrolled_fold_first
- {
- typedef typename get_func_base<F>::type f;
+ typedef typename
+ BOOST_PP_CAT(result_of_unrolled_,BOOST_FUSION_FOLD_NAME)<
+ typename boost::result_of<
+ f(
+ StateRef,
+ BOOST_FUSION_FOLD_IMPL_INVOKE_IT_META_TRANSFORM(It0)
+ )
+ >::type
+ , typename result_of::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION<
+ It0
+ >::type
+ , f
+ , SeqSize-1
+ >::type
+ type;
+ };
 
- typedef typename
- result_of_unrolled_fold<
- typename fold_apply<StateRef, It0, f>::type
- , typename result_of::next<It0>::type
- , f
- , SeqSize-1
- >::type
- type;
- };
+ template<int SeqSize, typename StateRef, typename It0, typename F>
+ struct BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME,_impl)
+ {
+ typedef preevaluate<F> preevaluater;
 
- template<int SeqSize, typename StateRef, typename It0, typename F>
- struct fold_impl
- {
- typedef preevaluate<F> preevaluater;
+ typedef typename
+ mpl::eval_if<
+ typename preevaluater::is_preevaluable
+ , preevaluater
+ , BOOST_PP_CAT(
+ result_of_first_unrolled,BOOST_FUSION_FOLD_NAME)<
+ StateRef
+ , BOOST_FUSION_FOLD_IMPL_FIRST_IT_META_TRANSFORM(It0)
+ , F
+ , SeqSize
+ >
+ >::type
+ type;
 
- typedef typename
- mpl::eval_if<
- typename preevaluater::is_preevaluable
- , preevaluater
- , result_of_unrolled_fold_first<
- StateRef
- , It0
- , F
+ static type
+ call(StateRef state, It0 const& it0, F f)
+ {
+ return BOOST_PP_CAT(unrolled_,BOOST_FUSION_FOLD_NAME)<
+ type
                   , SeqSize
- >
- >::type
- type;
-
- static type
- call(StateRef state, It0 const& it0, F f)
- {
- return unrolled_fold<type, SeqSize>::call(
+ >::call(
                     BOOST_FUSION_FORWARD(StateRef,state),
- it0,
+ BOOST_FUSION_FOLD_IMPL_FIRST_IT_TRANSFORM(it0),
                     BOOST_FUSION_FORWARD(F,f));
- }
- };
+ }
+ };
 
- template<typename StateRef, typename It0, typename F>
- struct fold_impl<0,StateRef,It0,F>
- {
- typedef StateRef type;
+ template<typename StateRef, typename It0, typename F>
+ struct BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME,_impl)<0,StateRef,It0,F>
+ {
+ typedef StateRef type;
 
- static StateRef
- call(StateRef state, It0 const&, F)
+ static StateRef
+ call(StateRef state, It0 const&, F)
+ {
+ return state;
+ }
+ };
+ }
+
+ namespace result_of
+ {
+ template<typename Seq, typename State, typename F>
+ struct BOOST_FUSION_FOLD_NAME
+ : detail::BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME,_impl)<
+ size<Seq>::value
+ , typename detail::add_lref<
+#ifdef BOOST_NO_RVALUE_REFERENCES
+ typename add_const<
+#endif
+ State
+#ifdef BOOST_NO_RVALUE_REFERENCES
+ >::type
+#endif
+ >::type
+ , typename BOOST_FUSION_FOLD_IMPL_FIRST_IT_FUNCTION<Seq>::type
+ , F
+ >
         {
- return state;
- }
- };
-}}}
+ BOOST_FUSION_MPL_ASSERT((traits::is_sequence<Seq>));
+ BOOST_FUSION_MPL_ASSERT((traits::is_forward<Seq>));
+ };
+ }
+
+ template<typename Seq, typename State, typename F>
+ inline typename result_of::BOOST_FUSION_FOLD_NAME<
+ BOOST_FUSION_R_ELSE_CLREF(Seq)
+ , BOOST_FUSION_R_ELSE_CLREF(State)
+ , BOOST_FUSION_RREF_ELSE_OBJ(F)
+ >::type
+ BOOST_FUSION_FOLD_NAME(BOOST_FUSION_R_ELSE_CLREF(Seq) seq,
+ BOOST_FUSION_R_ELSE_CLREF(State) state,
+ BOOST_FUSION_RREF_ELSE_OBJ(F) f)
+ {
+ return result_of::BOOST_FUSION_FOLD_NAME<
+ BOOST_FUSION_R_ELSE_CLREF(Seq)
+ , BOOST_FUSION_R_ELSE_CLREF(State)
+ , BOOST_FUSION_RREF_ELSE_OBJ(F)
+ >::call(
+ BOOST_FUSION_FORWARD(State,state),
+ fusion::BOOST_FUSION_FOLD_IMPL_FIRST_IT_FUNCTION(
+ BOOST_FUSION_FORWARD(Seq,seq)),
+ BOOST_FUSION_FORWARD(F,f));
+ }
 
+#ifdef BOOST_NO_RVALUE_REFERENCES
+ template<typename Seq, typename State, typename F>
+ inline typename result_of::fold<Seq&,State const&,F>::type
+ BOOST_FUSION_FOLD_NAME(Seq& seq,State const& state,F f)
+ {
+ return result_of::BOOST_FUSION_FOLD_NAME<Seq&,State const&,F>::call(
+ state,
+ fusion::BOOST_FUSION_FOLD_IMPL_FIRST_IT_FUNCTION(seq),
+ f);
+ }
 #endif
+}}
+
+#undef BOOST_FUSION_FOLD_NAME
+#undef BOOST_FUSION_FOLD_IMPL_FIRST_IT_FUNCTION
+#undef BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION
+#undef BOOST_FUSION_FOLD_IMPL_FIRST_IT_META_TRANSFORM
+#undef BOOST_FUSION_FOLD_IMPL_FIRST_IT_TRANSFORM
+#undef BOOST_FUSION_FOLD_IMPL_INVOKE_IT_TRANSFORM

Modified: sandbox/SOC/2009/fusion/boost/fusion/algorithm/iteration/fold.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/algorithm/iteration/fold.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/algorithm/iteration/fold.hpp 2010-06-13 12:50:06 EDT (Sun, 13 Jun 2010)
@@ -1,7 +1,7 @@
 /*=============================================================================
     Copyright (c) 2001-2007 Joel de Guzman
     Copyright (c) 2007 Dan Marsden
- Copyright (c) 2009 Christopher Schmidt
+ Copyright (c) 2009-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)
@@ -10,72 +10,6 @@
 #ifndef BOOST_FUSION_ALGORITHM_ITERATION_FOLD_HPP
 #define BOOST_FUSION_ALGORITHM_ITERATION_FOLD_HPP
 
-#include <boost/config.hpp>
-#include <boost/fusion/sequence/intrinsic/size.hpp>
-#include <boost/fusion/support/internal/ref.hpp>
-#include <boost/fusion/support/internal/assert.hpp>
-
-#ifdef BOOST_NO_RVALUE_REFERENCES
-# include <boost/type_traits/add_const.hpp>
-#endif
-
 #include <boost/fusion/algorithm/iteration/detail/fold.hpp>
 
-namespace boost { namespace fusion
-{
- namespace result_of
- {
- template<typename Seq, typename State, typename F>
- struct fold
- : detail::fold_impl<
- size<Seq>::value
- , typename detail::add_lref<
-#ifdef BOOST_NO_RVALUE_REFERENCES
- typename add_const<
-#endif
- State
-#ifdef BOOST_NO_RVALUE_REFERENCES
- >::type
-#endif
- >::type
- , typename begin<Seq>::type
- , F
- >
- {
- BOOST_FUSION_MPL_ASSERT((traits::is_sequence<Seq>));
- BOOST_FUSION_MPL_ASSERT((traits::is_forward<Seq>));
- };
- }
-
- template<typename Seq, typename State, typename F>
- inline typename result_of::fold<
- BOOST_FUSION_R_ELSE_CLREF(Seq)
- , BOOST_FUSION_R_ELSE_CLREF(State)
- , BOOST_FUSION_RREF_ELSE_OBJ(F)
- >::type
- fold(BOOST_FUSION_R_ELSE_CLREF(Seq) seq,
- BOOST_FUSION_R_ELSE_CLREF(State) state,
- BOOST_FUSION_RREF_ELSE_OBJ(F) f)
- {
- return result_of::fold<
- BOOST_FUSION_R_ELSE_CLREF(Seq)
- , BOOST_FUSION_R_ELSE_CLREF(State)
- , BOOST_FUSION_RREF_ELSE_OBJ(F)
- >::call(
- BOOST_FUSION_FORWARD(State,state),
- fusion::begin(BOOST_FUSION_FORWARD(Seq,seq)),
- BOOST_FUSION_FORWARD(F,f));
- }
-
-#ifdef BOOST_NO_RVALUE_REFERENCES
- template<typename Seq, typename State, typename F>
- inline typename result_of::fold<Seq&,State const&,F>::type
- fold(Seq& seq,State const& state,F f)
- {
- return result_of::fold<Seq&,State const&,F>::call(
- state, fusion::begin(seq), f);
- }
-#endif
-}}
-
 #endif

Added: sandbox/SOC/2009/fusion/boost/fusion/algorithm/iteration/iter_fold.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/fusion/boost/fusion/algorithm/iteration/iter_fold.hpp 2010-06-13 12:50:06 EDT (Sun, 13 Jun 2010)
@@ -0,0 +1,17 @@
+/*=============================================================================
+ 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_ALGORITHM_ITERATION_ITER_FOLD_HPP
+#define BOOST_FUSION_ALGORITHM_ITERATION_ITER_FOLD_HPP
+
+#define BOOST_FUSION_ITER_FOLD
+
+#include <boost/fusion/algorithm/iteration/detail/fold.hpp>
+
+#undef BOOST_FUSION_REVERSE_FOLD
+
+#endif

Added: sandbox/SOC/2009/fusion/boost/fusion/algorithm/iteration/reverse_fold.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/fusion/boost/fusion/algorithm/iteration/reverse_fold.hpp 2010-06-13 12:50:06 EDT (Sun, 13 Jun 2010)
@@ -0,0 +1,17 @@
+/*=============================================================================
+ 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_ALGORITHM_ITERATION_REVERSE_FOLD_HPP
+#define BOOST_FUSION_ALGORITHM_ITERATION_REVERSE_FOLD_HPP
+
+#define BOOST_FUSION_REVERSE_FOLD
+
+#include <boost/fusion/algorithm/iteration/detail/fold.hpp>
+
+#undef BOOST_FUSION_REVERSE_FOLD
+
+#endif

Added: sandbox/SOC/2009/fusion/boost/fusion/algorithm/iteration/reverse_iter_fold.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/fusion/boost/fusion/algorithm/iteration/reverse_iter_fold.hpp 2010-06-13 12:50:06 EDT (Sun, 13 Jun 2010)
@@ -0,0 +1,19 @@
+/*=============================================================================
+ 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_ALGORITHM_ITERATION_REVERSE_ITER_FOLD_HPP
+#define BOOST_FUSION_ALGORITHM_ITERATION_REVERSE_ITER_FOLD_HPP
+
+#define BOOST_FUSION_REVERSE_FOLD
+#define BOOST_FUSION_ITER_FOLD
+
+#include <boost/fusion/algorithm/iteration/detail/fold.hpp>
+
+#undef BOOST_FUSION_REVERSE_FOLD
+#undef BOOST_FUSION_ITER_FOLD
+
+#endif

Modified: sandbox/SOC/2009/fusion/boost/fusion/algorithm/transformation/filter_if.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/algorithm/transformation/filter_if.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/algorithm/transformation/filter_if.hpp 2010-06-13 12:50:06 EDT (Sun, 13 Jun 2010)
@@ -1,5 +1,6 @@
 /*=============================================================================
     Copyright (c) 2001-2006 Joel de Guzman
+ Copyright (c) 2009-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)
@@ -8,22 +9,36 @@
 #ifndef BOOST_FUSION_ALGORITHM_TRANSFORMATION_FILTER_IF_HPP
 #define BOOST_FUSION_ALGORITHM_TRANSFORMATION_FILTER_IF_HPP
 
+#include <boost/config.hpp>
 #include <boost/fusion/view/filter_view/filter_view.hpp>
 #include <boost/fusion/support/internal/ref.hpp>
 #include <boost/fusion/support/internal/assert.hpp>
 #include <boost/fusion/support/internal/workaround.hpp>
+#include <boost/mpl/bool.hpp>
+#ifdef BOOST_NO_RVALUE_REFERENCES
+# include <boost/detail/workaround.hpp>
+# if defined(BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS) ||\
+ BOOST_WORKAROUND(__GNUC__,<4)
+# include <boost/type_traits/is_const.hpp>
+# include <boost/utility/enable_if.hpp>
+# endif
+#endif
 
 namespace boost { namespace fusion
 {
     namespace result_of
     {
- template<typename Seq, typename Pred>
+ template<
+ typename Seq
+ , typename Pred
+ , typename PredIsMetafunction=mpl::true_
+ >
         struct filter_if
         {
             BOOST_FUSION_MPL_ASSERT((traits::is_sequence<Seq>));
             BOOST_FUSION_MPL_ASSERT((traits::is_forward<Seq>));
 
- typedef filter_view<Seq, Pred> type;
+ typedef filter_view<Seq, Pred, PredIsMetafunction> type;
         };
     }
     
@@ -46,6 +61,42 @@
         return typename result_of::filter_if<Seq&, Pred>::type(seq);
     }
 #endif
+
+ template<typename Pred, typename PredIsMetafunction, typename Seq>
+ inline typename result_of::filter_if<
+ BOOST_FUSION_R_ELSE_CLREF(Seq)
+ , Pred
+ , PredIsMetafunction
+ >::type
+ filter_if(BOOST_FUSION_R_ELSE_CLREF(Seq) seq)
+ {
+ return typename result_of::filter_if<
+ BOOST_FUSION_R_ELSE_CLREF(Seq)
+ , Pred
+ , PredIsMetafunction
+ >::type(BOOST_FUSION_FORWARD(Seq,seq));
+ }
+
+#ifdef BOOST_NO_RVALUE_REFERENCES
+ template<typename Pred, typename PredIsMetafunction, typename Seq>
+# if defined(BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS) ||\
+ BOOST_WORKAROUND(__GNUC__,<4)
+ inline typename lazy_disable_if<
+ is_const<Seq>
+ , result_of::filter_if<Seq&,Pred,PredIsMetafunction>
+ >::type
+# else
+ inline typename result_of::filter_if<Seq&,Pred,PredIsMetafunction>::type
+# endif
+ filter_if(Seq& seq)
+ {
+ return typename result_of::filter_if<
+ Seq&
+ , Pred
+ , PredIsMetafunction
+ >::type(seq);
+ }
+#endif
 }}
 
 #endif

Modified: sandbox/SOC/2009/fusion/boost/fusion/container/detail/forward_interface.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/container/detail/forward_interface.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/container/detail/forward_interface.hpp 2010-06-13 12:50:06 EDT (Sun, 13 Jun 2010)
@@ -1,13 +1,17 @@
 /*=============================================================================
- Copyright (c) 2009 Christopher Schmidt
+ Copyright (c) 2009-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(BOOST_FUSION_SEQ_NAME) && !defined(BOOST_FUSION_CONTAINER_DETAIL_FORWARD_INTERFACE_HPP)
+#if !defined(BOOST_FUSION_SEQ_NAME) &&\
+ !defined(BOOST_FUSION_CONTAINER_DETAIL_FORWARD_INTERFACE_HPP)
 # define BOOST_FUSION_CONTAINER_DETAIL_FORWARD_INTERFACE_HPP
+
 # include <boost/config.hpp>
+# include <boost/fusion/support/internal/sequence_assign.hpp>
+
 #endif
 
 #ifndef BOOST_FUSION_SEQ_NAME
@@ -46,12 +50,12 @@
 # include <boost/fusion/container/detail/variadic_templates/forward_interface.hpp>
 # endif
 
-#ifdef BOOST_NO_RVALUE_REFERENCES
- template<typename Arg>
- BOOST_FUSION_SEQ_NAME(BOOST_FUSION_R_ELSE_CLREF(Arg) arg)
- : BOOST_FUSION_INIT_BASE(BOOST_FUSION_FORWARD(Arg, arg))
- {}
-#endif
+# if defined(BOOST_NO_RVALUE_REFERENCES) || !defined(BOOST_NO_VARIADIC_TEMPLATES)
+ template<typename Arg>
+ BOOST_FUSION_SEQ_NAME(BOOST_FUSION_R_ELSE_CLREF(Arg) arg)
+ : BOOST_FUSION_INIT_BASE(BOOST_FUSION_FORWARD(Arg, arg))
+ {}
+# endif
 
 # undef BOOST_FUSION_INIT_BASE
 

Modified: sandbox/SOC/2009/fusion/boost/fusion/container/detail/pp/forward_interface_n.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/container/detail/pp/forward_interface_n.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/container/detail/pp/forward_interface_n.hpp 2010-06-13 12:50:06 EDT (Sun, 13 Jun 2010)
@@ -7,15 +7,14 @@
 
 #define BOOST_FUSION_N BOOST_PP_ITERATION()
 
-#ifndef BOOST_NO_RVALUE_REFERENCES
- VARIADIC_TEMPLATE_A(BOOST_FUSION_N)
-#endif
 #ifdef BOOST_NO_RVALUE_REFERENCES
-# if BOOST_FUSION_N == 1
     explicit
-# endif
     BOOST_FUSION_SEQ_NAME(EXPAND_TEMPLATE_ARGUMENTS_CALL_PARAMS(BOOST_FUSION_N))
 #else
+ VARIADIC_TEMPLATE_A(BOOST_FUSION_N)
+# if BOOST_FUSION_N!=1
+ explicit
+# endif
     BOOST_FUSION_SEQ_NAME(\
         EXPAND_TEMPLATE_ARGUMENTS_PARAMETERS_A_R_ELSE_CLREF(BOOST_FUSION_N))
 #endif

Modified: sandbox/SOC/2009/fusion/boost/fusion/container/detail/variadic_templates/forward_interface.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/container/detail/variadic_templates/forward_interface.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/container/detail/variadic_templates/forward_interface.hpp 2010-06-13 12:50:06 EDT (Sun, 13 Jun 2010)
@@ -22,6 +22,7 @@
         {}
 # else
         template<typename... OtherArguments>
+ explicit
         BOOST_FUSION_SEQ_NAME(OtherArguments&&... arguments)
           : BOOST_FUSION_INIT_BASE(std::forward<OtherArguments>(arguments)...)
         {}

Modified: sandbox/SOC/2009/fusion/boost/fusion/container/list/detail/pp/list_forward_ctor_n.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/container/list/detail/pp/list_forward_ctor_n.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/container/list/detail/pp/list_forward_ctor_n.hpp 2010-06-13 12:50:06 EDT (Sun, 13 Jun 2010)
@@ -7,15 +7,15 @@
 
 #define BOOST_FUSION_N BOOST_PP_ITERATION()
 
-#ifndef BOOST_NO_RVALUE_REFERENCES
- VARIADIC_TEMPLATE_A(BOOST_FUSION_N)
-#endif
-#if BOOST_FUSION_N == 1
- explicit
-#endif
+
 #ifdef BOOST_NO_RVALUE_REFERENCES
+ explicit
     list(EXPAND_TEMPLATE_ARGUMENTS_CALL_PARAMS(BOOST_FUSION_N))
 #else
+ VARIADIC_TEMPLATE_A(BOOST_FUSION_N)
+# if BOOST_FUSION_N!=1
+ explicit
+# endif
     list(EXPAND_TEMPLATE_ARGUMENTS_PARAMETERS_A_R_ELSE_CLREF(BOOST_FUSION_N))
 #endif
 #if BOOST_FUSION_N

Modified: sandbox/SOC/2009/fusion/boost/fusion/container/list/list.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/container/list/list.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/container/list/list.hpp 2010-06-13 12:50:06 EDT (Sun, 13 Jun 2010)
@@ -12,9 +12,10 @@
 #include <boost/config.hpp>
 #include <boost/fusion/container/list/list_fwd.hpp>
 #include <boost/fusion/container/list/cons.hpp>
+#include <boost/fusion/container/list/detail/cons_gen.hpp>
 #include <boost/fusion/container/generation/vector_tie.hpp>
 #include <boost/fusion/container/detail/forward_interface.hpp>
-#include <boost/fusion/container/list/detail/cons_gen.hpp>
+#include <boost/fusion/support/internal/template.hpp>
 
 namespace boost { namespace fusion
 {
@@ -49,10 +50,12 @@
 
 # include <boost/fusion/container/list/detail/pp/list_forward_ctor.hpp>
 
+# ifdef BOOST_NO_RVALUE_REFERENCES
         template<typename Seq>
         list(Seq const& seq)
           : base_type(seq)
         {}
+# endif
 
         template<typename Seq>
         list&

Modified: sandbox/SOC/2009/fusion/boost/fusion/container/vector/detail/pp/vector_n.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/container/vector/detail/pp/vector_n.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/container/vector/detail/pp/vector_n.hpp 2010-06-13 12:50:06 EDT (Sun, 13 Jun 2010)
@@ -157,9 +157,7 @@
 # ifndef BOOST_NO_RVALUE_REFERENCES
         VARIADIC_TEMPLATE_A(BOOST_FUSION_N)
 # endif
-# if BOOST_FUSION_N==1
         explicit
-# endif
         BOOST_PP_CAT(vector, BOOST_FUSION_N)(
 # ifdef BOOST_NO_RVALUE_REFERENCES
             EXPAND_TEMPLATE_ARGUMENTS_CALL_PARAMS(BOOST_FUSION_N)

Modified: sandbox/SOC/2009/fusion/boost/fusion/container/vector/detail/variadic_templates/vector_n.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/container/vector/detail/variadic_templates/vector_n.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/container/vector/detail/variadic_templates/vector_n.hpp 2010-06-13 12:50:06 EDT (Sun, 13 Jun 2010)
@@ -22,7 +22,7 @@
 #else
 # define BOOST_FUSION_N BOOST_PP_ITERATION()
 
- //cschmidt: template typedefs if possible...
+ //cschmidt: template aliases if possible (BOOST_NO_TEMPLATE_ALIASES)...
 namespace boost { namespace fusion
 {
 # if !BOOST_FUSION_N
@@ -55,29 +55,39 @@
 
 # undef BOOST_FUSION_VECTOR_CTOR
 
+#if BOOST_FUSION_N>1 || !BOOST_FUSION_N || defined(BOOST_NO_RVALUE_REFERENCES)
         template<typename Arg>
         BOOST_PP_CAT(vector, BOOST_FUSION_N)(BOOST_FUSION_R_ELSE_CLREF(Arg) arg)
           : base_type(BOOST_FUSION_FORWARD(Arg,arg))
         {}
+#endif
 
-# if BOOST_FUSION_N > 1
+# if BOOST_FUSION_N
 # ifdef BOOST_NO_RVALUE_REFERENCES
+ explicit
         BOOST_PP_CAT(vector, BOOST_FUSION_N)(
             BOOST_PP_ENUM_BINARY_PARAMS(N, call_traits<T,>::param_type a))
           : base_type(BOOST_PP_ENUM_PARAMS(BOOST_FUSION_N, a))
         {}
 # else
-# define BOOST_FUSION_FORWARD_ARGUMENT(Z, N, __)\
- std::forward<BOOST_PP_CAT(A,N)>(BOOST_PP_CAT(_,N))
-
         template<BOOST_PP_ENUM_PARAMS(BOOST_FUSION_N, typename A)>
+# if BOOST_FUSION_N!=1
+ explicit
+# endif
+
+# define BOOST_FUSION_EXPAND_VECTOR_EXPAND_PARAMETERS(Z,N,__)\
+ BOOST_FUSION_FORWARD(BOOST_PP_CAT(A,N),BOOST_PP_CAT(_,N))
+
         BOOST_PP_CAT(vector, BOOST_FUSION_N)(
- BOOST_PP_ENUM_BINARY_PARAMS(BOOST_FUSION_N, A,&& _))
- : base_type(
- BOOST_PP_ENUM(BOOST_FUSION_N, BOOST_FUSION_FORWARD_ARGUMENT, _))
+ BOOST_PP_ENUM_BINARY_PARAMS(BOOST_FUSION_N, A,&&_))
+ : base_type(BOOST_PP_ENUM(
+ BOOST_FUSION_N,
+ BOOST_FUSION_EXPAND_VECTOR_EXPAND_PARAMETERS,
+ _))
         {}
 
-# undef BOOST_FUSION_FORWARD_ARGUMENT
+# undef BOOST_FUSION_EXPAND_VECTOR_EXPAND_PARAMETERS
+
 # endif
 # endif
 

Added: sandbox/SOC/2009/fusion/boost/fusion/include/iter_fold.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/fusion/boost/fusion/include/iter_fold.hpp 2010-06-13 12:50:06 EDT (Sun, 13 Jun 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_ITER_FOLD_HPP
+#define BOOST_FUSION_INCLUDE_ITER_FOLD_HPP
+
+#include <boost/fusion/algorithm/iteration/iter_fold.hpp>
+
+#endif

Added: sandbox/SOC/2009/fusion/boost/fusion/include/reverse_fold.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/fusion/boost/fusion/include/reverse_fold.hpp 2010-06-13 12:50:06 EDT (Sun, 13 Jun 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_REVERSE_FOLD_HPP
+#define BOOST_FUSION_INCLUDE_REVERSE_FOLD_HPP
+
+#include <boost/fusion/algorithm/iteration/reverse_fold.hpp>
+
+#endif

Added: sandbox/SOC/2009/fusion/boost/fusion/include/reverse_iter_fold.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/fusion/boost/fusion/include/reverse_iter_fold.hpp 2010-06-13 12:50:06 EDT (Sun, 13 Jun 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_REVERSE_ITER_FOLD_HPP
+#define BOOST_FUSION_INCLUDE_REVERSE_ITER_FOLD_HPP
+
+#include <boost/fusion/algorithm/iteration/reverse_iter_fold.hpp>
+
+#endif

Modified: sandbox/SOC/2009/fusion/boost/fusion/support/internal/is_explicitly_convertible.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/support/internal/is_explicitly_convertible.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/support/internal/is_explicitly_convertible.hpp 2010-06-13 12:50:06 EDT (Sun, 13 Jun 2010)
@@ -9,9 +9,9 @@
 #define BOOST_FUSION_SUPPORT_INTERNAL_IS_EXPLICITLY_CONVERTIBLE_HPP
 
 #include <boost/detail/workaround.hpp>
-#if BOOST_WORKAROUND(__GNUC__,<4)
-# include <boost/type_traits/is_convertible.hpp>
-#else
+#include <boost/type_traits/is_convertible.hpp>
+#if BOOST_WORKAROUND(__GNUC__,>=4)
+# include <boost/mpl/or.hpp>
 # include <boost/fusion/support/internal/small_big_type.hpp>
 # include <boost/mpl/bool.hpp>
 # include <cstddef>
@@ -20,7 +20,7 @@
 namespace boost { namespace fusion { namespace detail
 {
 //cschmidt: Fall back due to a defect in gcc 3.x's call_expr...
-#if BOOST_WORKAROUND(__GNUC__,<4)
+#if BOOST_WORKAROUND(__GNUC__,<4) || defined(BOOST_MSVC)
     template<typename From, typename To>
     struct is_explicitly_convertible
       : is_convertible<From,To>
@@ -42,6 +42,7 @@
     template<typename From, typename To>
     struct is_explicitly_convertible_impl
     {
+ //cschmidt: is this even valid C++?
         template<typename T>
         static typename helper<sizeof(static_cast<T>(get_t<From>()),0)>::type
         impl(int);
@@ -55,7 +56,10 @@
 
     template<typename From, typename To>
     struct is_explicitly_convertible
- : is_explicitly_convertible_impl<From,To>::type
+ : mpl::or_<
+ is_explicitly_convertible_impl<From,To>
+ , is_convertible<From,To>
+ >
     {};
 #endif
 }}}

Modified: sandbox/SOC/2009/fusion/boost/fusion/support/internal/workaround.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/support/internal/workaround.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/support/internal/workaround.hpp 2010-06-13 12:50:06 EDT (Sun, 13 Jun 2010)
@@ -9,21 +9,23 @@
 #define BOOST_FUSION_SUPPORT_INTERNAL_WORKAROUND_HPP
 
 #include <boost/config.hpp>
-#include <boost/detail/workaround.hpp>
-
 #ifdef BOOST_NO_RVALUE_REFERENCES
+# include <boost/detail/workaround.hpp>
 //cschmidt: see https://svn.boost.org/trac/boost/ticket/3305
-# if defined(BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS) || BOOST_WORKAROUND(__GNUC__,<4)
+# if defined(BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS) ||\
+ BOOST_WORKAROUND(__GNUC__,<4)
 # include <boost/type_traits/is_const.hpp>
 # include <boost/utility/enable_if.hpp>
 
-# define BOOST_FUSION_EXPLICIT_TEMPLATE_NON_CONST_ARG_OVERLOAD(PRE,ARG,ARG_MODIFIER,POST)\
+# define BOOST_FUSION_EXPLICIT_TEMPLATE_NON_CONST_ARG_OVERLOAD(\
+ PRE,ARG,ARG_MODIFIER,POST)\
             typename lazy_disable_if<\
                 is_const<ARG>\
               , PRE ARG ARG_MODIFIER, POST\
>::type
 # else
-# define BOOST_FUSION_EXPLICIT_TEMPLATE_NON_CONST_ARG_OVERLOAD(PRE,ARG,ARG_MODIFIER,POST)\
+# define BOOST_FUSION_EXPLICIT_TEMPLATE_NON_CONST_ARG_OVERLOAD(\
+ PRE,ARG,ARG_MODIFIER,POST)\
             typename PRE ARG ARG_MODIFIER, POST ::type
 # endif
 #endif

Modified: sandbox/SOC/2009/fusion/boost/fusion/support/sequence_base.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/support/sequence_base.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/support/sequence_base.hpp 2010-06-13 12:50:06 EDT (Sun, 13 Jun 2010)
@@ -37,16 +37,6 @@
 
         struct fusion_sequence_tag;
     }
-
- namespace mpl
- {
- // Deliberately break mpl::begin, so it doesn't lie that a Fusion
- // sequence is not an MPL sequence by returning mpl::void_.
- // In other words: Fusion Sequences are always MPL Sequences, but they
- // can be incompletely defined.
- template<>
- struct begin_impl<fusion::fusion_sequence_tag>;
- }
 }
 
 #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-06-13 12:50:06 EDT (Sun, 13 Jun 2010)
@@ -24,6 +24,7 @@
 #include <boost/mpl/not.hpp>
 #include <boost/mpl/assert.hpp>
 #include <boost/mpl/placeholders.hpp>
+#include <boost/mpl/bool.hpp>
 
 namespace boost { namespace fusion
 {
@@ -32,6 +33,14 @@
 
     namespace detail
     {
+ struct not_is_empty
+ {
+ template<typename Arg>
+ struct apply
+ : mpl::not_<result_of::empty<Arg> >
+ {};
+ };
+
         template<typename Sequence, typename Iterator, bool IsSegmented>
         struct segmented_range
           : sequence_base<segmented_range<Sequence, Iterator, IsSegmented> >
@@ -41,7 +50,11 @@
             typedef typename
                 mpl::if_c<
                     IsSegmented
- , filter_view<Sequence, mpl::not_<result_of::empty<mpl::_1> > >
+ , filter_view<
+ Sequence
+ , not_is_empty
+ , mpl::false_
+ >
                   , Sequence
>::type
             sequence_non_ref_type;
@@ -187,7 +200,7 @@
         {
             typedef typename result_of::segments<Sequence>::type segments;
             typedef typename remove_reference<segments>::type sequence;
- typedef typename result_of::begin<filter_view<sequence, mpl::not_<result_of::empty<mpl::_1> > > >::type begin;
+ typedef typename result_of::begin<filter_view<sequence, not_is_empty, mpl::false_ > >::type begin;
             typedef segmented_range<sequence, begin, true> type;
 
             static type call(Sequence &seq)
@@ -241,7 +254,7 @@
             static type call(Sequence &seq, State const &state)
             {
                 range rng(as_segmented_range<Sequence>::call(seq));
- next_ref nxt(*fusion::begin(rng));
+ next_ref nxt(fusion::deref(fusion::begin(rng)));
                 return push::call(nxt, fusion::make_cons(rng, state));
             }
         };

Modified: sandbox/SOC/2009/fusion/boost/fusion/view/filter_view/detail/begin_impl.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/view/filter_view/detail/begin_impl.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/view/filter_view/detail/begin_impl.hpp 2010-06-13 12:50:06 EDT (Sun, 13 Jun 2010)
@@ -1,5 +1,6 @@
 /*=============================================================================
     Copyright (c) 2001-2006 Joel de Guzman
+ Copyright (c) 2009-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)
@@ -28,11 +29,12 @@
             underlying_seq_type;
 
             typedef
- filter_iterator<
+ filter_view_iterator<
                     typename seq::category
                   , typename result_of::begin<underlying_seq_type>::type
                   , typename result_of::end<underlying_seq_type>::type
                   , typename seq::pred_type
+ , typename seq::pred_is_metafunction
>
             type;
 

Modified: sandbox/SOC/2009/fusion/boost/fusion/view/filter_view/detail/deref_data_impl.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/view/filter_view/detail/deref_data_impl.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/view/filter_view/detail/deref_data_impl.hpp 2010-06-13 12:50:06 EDT (Sun, 13 Jun 2010)
@@ -1,5 +1,6 @@
 /*=============================================================================
     Copyright (c) 2009 Christopher Schmidt
+ Copyright (c) 2009-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)

Modified: sandbox/SOC/2009/fusion/boost/fusion/view/filter_view/detail/deref_impl.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/view/filter_view/detail/deref_impl.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/view/filter_view/detail/deref_impl.hpp 2010-06-13 12:50:06 EDT (Sun, 13 Jun 2010)
@@ -1,5 +1,6 @@
 /*=============================================================================
     Copyright (c) 2001-2006 Joel de Guzman
+ Copyright (c) 2009-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)

Modified: sandbox/SOC/2009/fusion/boost/fusion/view/filter_view/detail/end_impl.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/view/filter_view/detail/end_impl.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/view/filter_view/detail/end_impl.hpp 2010-06-13 12:50:06 EDT (Sun, 13 Jun 2010)
@@ -1,5 +1,6 @@
 /*=============================================================================
     Copyright (c) 2001-2006 Joel de Guzman
+ Copyright (c) 2009-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)
@@ -27,11 +28,12 @@
             underlying_seq_type;
 
             typedef
- filter_iterator<
+ filter_view_iterator<
                     typename seq::category
                   , typename result_of::end<underlying_seq_type>::type
                   , typename result_of::end<underlying_seq_type>::type
                   , typename seq::pred_type
+ , typename seq::pred_is_metafunction
>
             type;
 

Modified: sandbox/SOC/2009/fusion/boost/fusion/view/filter_view/detail/equal_to_impl.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/view/filter_view/detail/equal_to_impl.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/view/filter_view/detail/equal_to_impl.hpp 2010-06-13 12:50:06 EDT (Sun, 13 Jun 2010)
@@ -1,6 +1,7 @@
 /*=============================================================================
     Copyright (c) 2001-2006 Joel de Guzman
     Copyright (c) 2005-2006 Dan Marsden
+ Copyright (c) 2009-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)

Modified: sandbox/SOC/2009/fusion/boost/fusion/view/filter_view/detail/filter_view_iterator.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/view/filter_view/detail/filter_view_iterator.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/view/filter_view/detail/filter_view_iterator.hpp 2010-06-13 12:50:06 EDT (Sun, 13 Jun 2010)
@@ -1,6 +1,6 @@
 /*=============================================================================
     Copyright (c) 2001-2006 Joel de Guzman
- Copyright (c) 2009 Christopher Schmidt
+ Copyright (c) 2009-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)
@@ -18,22 +18,37 @@
 #include <boost/mpl/lambda.hpp>
 #include <boost/mpl/bind.hpp>
 #include <boost/mpl/placeholders.hpp>
+#include <boost/mpl/eval_if.hpp>
+#include <boost/mpl/identity.hpp>
 
 namespace boost { namespace fusion
 {
     struct filter_view_iterator_tag;
 
- template<typename Category,typename Begin, typename End, typename Pred>
- struct filter_iterator
- : iterator_base<filter_iterator<Category, Begin, End, Pred> >
+ template<
+ typename Category
+ , typename Begin
+ , typename End
+ , typename Pred
+ , typename PredIsMetafunction
+ >
+ struct filter_view_iterator
+ : iterator_base<
+ filter_view_iterator<Category, Begin, End, Pred,PredIsMetafunction>
+ >
     {
+ typedef PredIsMetafunction pred_is_metafunction;
         typedef Pred pred_type;
         typedef
             detail::static_find_if<
                 Begin
               , End
               , mpl::bind1<
- typename mpl::lambda<Pred>::type
+ typename mpl::eval_if<
+ pred_is_metafunction
+ , mpl::lambda<Pred>
+ , mpl::identity<Pred>
+ >::type
                   , mpl::bind1<mpl::quote1<result_of::value_of>,mpl::_1>
>
>
@@ -45,18 +60,18 @@
         typedef Category category;
 
         template<typename OtherIt>
- filter_iterator(BOOST_FUSION_R_ELSE_CLREF(OtherIt) it)
+ filter_view_iterator(BOOST_FUSION_R_ELSE_CLREF(OtherIt) it)
           : first(BOOST_FUSION_FORWARD(OtherIt,it).first)
         {
             BOOST_FUSION_TAG_CHECK(OtherIt,filter_view_iterator_tag);
         }
 
- filter_iterator(Begin const& first,int)
+ filter_view_iterator(Begin const& first,int)
           : first(filter::call(first))
         {}
 
         template<typename OtherIt>
- filter_iterator&
+ filter_view_iterator&
         operator=(BOOST_FUSION_R_ELSE_CLREF(OtherIt) it)
         {
             BOOST_FUSION_TAG_CHECK(OtherIt,filter_view_iterator_tag);

Modified: sandbox/SOC/2009/fusion/boost/fusion/view/filter_view/detail/key_of_impl.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/view/filter_view/detail/key_of_impl.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/view/filter_view/detail/key_of_impl.hpp 2010-06-13 12:50:06 EDT (Sun, 13 Jun 2010)
@@ -1,5 +1,6 @@
 /*=============================================================================
     Copyright (c) 2009 Christopher Schmidt
+ Copyright (c) 2009-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)

Modified: sandbox/SOC/2009/fusion/boost/fusion/view/filter_view/detail/next_impl.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/view/filter_view/detail/next_impl.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/view/filter_view/detail/next_impl.hpp 2010-06-13 12:50:06 EDT (Sun, 13 Jun 2010)
@@ -1,5 +1,6 @@
 /*=============================================================================
     Copyright (c) 2001-2006 Joel de Guzman
+ Copyright (c) 2009-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)
@@ -8,7 +9,7 @@
 #ifndef BOOST_FUSION_VIEW_FILTER_VIEW_DETAIL_NEXT_IMPL_HPP
 #define BOOST_FUSION_VIEW_FILTER_VIEW_DETAIL_NEXT_IMPL_HPP
 
-#include <boost/fusion/algorithm/query/detail/find_if.hpp>
+#include <boost/fusion/iterator/next.hpp>
 
 namespace boost { namespace fusion { namespace extension
 {
@@ -23,29 +24,19 @@
         {
             typedef typename detail::remove_reference<It>::type it;
             typedef
- detail::static_find_if<
- typename result_of::next<typename it::begin_type>::type
- , typename it::end_type
- , mpl::bind1<
- typename mpl::lambda<typename it::pred_type>::type
- , mpl::bind1<mpl::quote1<result_of::value_of>,mpl::_1>
- >
- >
- filter;
-
- typedef
- filter_iterator<
+ filter_view_iterator<
                     typename it::category
- , typename filter::type
+ , typename result_of::next<typename it::begin_type>::type
                   , typename it::end_type
                   , typename it::pred_type
+ , typename it::pred_is_metafunction
>
             type;
 
             static type
             call(It it)
             {
- return type(filter::call(it.first),0);
+ return type(fusion::next(it.first),0);
             }
         };
     };

Modified: sandbox/SOC/2009/fusion/boost/fusion/view/filter_view/detail/size_impl.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/view/filter_view/detail/size_impl.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/view/filter_view/detail/size_impl.hpp 2010-06-13 12:50:06 EDT (Sun, 13 Jun 2010)
@@ -1,5 +1,6 @@
 /*=============================================================================
     Copyright (c) 2001-2006 Joel de Guzman
+ Copyright (c) 2009-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)

Modified: sandbox/SOC/2009/fusion/boost/fusion/view/filter_view/detail/value_of_data_impl.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/view/filter_view/detail/value_of_data_impl.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/view/filter_view/detail/value_of_data_impl.hpp 2010-06-13 12:50:06 EDT (Sun, 13 Jun 2010)
@@ -1,5 +1,6 @@
 /*=============================================================================
     Copyright (c) 2009 Christopher Schmidt
+ Copyright (c) 2009-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)

Modified: sandbox/SOC/2009/fusion/boost/fusion/view/filter_view/detail/value_of_impl.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/view/filter_view/detail/value_of_impl.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/view/filter_view/detail/value_of_impl.hpp 2010-06-13 12:50:06 EDT (Sun, 13 Jun 2010)
@@ -1,5 +1,6 @@
 /*=============================================================================
     Copyright (c) 2001-2006 Joel de Guzman
+ Copyright (c) 2009-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)

Modified: sandbox/SOC/2009/fusion/boost/fusion/view/filter_view/filter_view.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/view/filter_view/filter_view.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/view/filter_view/filter_view.hpp 2010-06-13 12:50:06 EDT (Sun, 13 Jun 2010)
@@ -1,6 +1,6 @@
 /*=============================================================================
     Copyright (c) 2001-2006 Joel de Guzman
- Copyright (c) 2009 Christopher Schmidt
+ Copyright (c) 2009-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)
@@ -38,9 +38,13 @@
 {
     struct fusion_sequence_tag;
 
- template<typename Seq, typename Pred>
+ template<
+ typename Seq
+ , typename Pred
+ , typename PredIsMetafunction=mpl::true_
+ >
     struct filter_view
- : sequence_base<filter_view<Seq, Pred> >
+ : sequence_base<filter_view<Seq, Pred, PredIsMetafunction> >
     {
         BOOST_FUSION_MPL_ASSERT((traits::is_sequence<Seq>));
         BOOST_FUSION_MPL_ASSERT((traits::is_forward<Seq>));
@@ -48,6 +52,7 @@
         typedef detail::view_storage<Seq> storage_type;
         typedef typename storage_type::type seq_type;
         typedef Pred pred_type;
+ typedef PredIsMetafunction pred_is_metafunction;
 
         typedef typename
             mpl::eval_if<
@@ -62,8 +67,11 @@
 
 #define BOOST_FUSION_FILTER_VIEW_CTOR(MODIFIER,_)\
         template<typename OtherSeq>\
- filter_view(filter_view<OtherSeq, Pred> MODIFIER view)\
- : seq(static_cast<filter_view<OtherSeq, Pred> MODIFIER>(view).seq)\
+ filter_view(\
+ filter_view<OtherSeq, Pred, PredIsMetafunction> MODIFIER view)\
+ : seq(static_cast<\
+ filter_view<OtherSeq, Pred, PredIsMetafunction> MODIFIER\
+ >(view).seq)\
         {}
 
         BOOST_FUSION_ALL_CTOR_COMBINATIONS(BOOST_FUSION_FILTER_VIEW_CTOR,_)

Modified: sandbox/SOC/2009/fusion/boost/fusion/view/iterator_range/iterator_range.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/view/iterator_range/iterator_range.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/view/iterator_range/iterator_range.hpp 2010-06-13 12:50:06 EDT (Sun, 13 Jun 2010)
@@ -56,6 +56,7 @@
             BOOST_FUSION_TAG_CHECK(OtherRange,iterator_range_tag);
         }
 
+ explicit
         iterator_range(Begin const& first, End const& last)
           : first(first)
           , last(last)

Modified: sandbox/SOC/2009/fusion/boost/fusion/view/joint_view/joint_view.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/view/joint_view/joint_view.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/view/joint_view/joint_view.hpp 2010-06-13 12:50:06 EDT (Sun, 13 Jun 2010)
@@ -85,6 +85,7 @@
         }
 
 #ifdef BOOST_NO_RVALUE_REFERENCES
+ explicit
         joint_view(typename storage1_type::call_param seq1,
                typename storage2_type::call_param seq2)
           : seq1(seq1)
@@ -92,6 +93,7 @@
         {}
 #else
         template<typename OtherSeq1, typename OtherSeq2>
+ explicit
         joint_view(BOOST_FUSION_R_ELSE_CLREF(OtherSeq1) seq1,
                 BOOST_FUSION_R_ELSE_CLREF(OtherSeq2) seq2)
           : seq1(BOOST_FUSION_FORWARD(OtherSeq1,seq1))

Modified: sandbox/SOC/2009/fusion/boost/fusion/view/single_view/single_view.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/view/single_view/single_view.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/view/single_view/single_view.hpp 2010-06-13 12:50:06 EDT (Sun, 13 Jun 2010)
@@ -24,10 +24,10 @@
 #include <boost/detail/workaround.hpp>
 #include <boost/mpl/bool.hpp>
 #include <boost/mpl/int.hpp>
-#ifdef BOOST_NO_RVALUE_REFERENCES
+#include <boost/utility/enable_if.hpp>
+#if defined(BOOST_NO_VARIADIC_TEMPLATES) && defined(BOOST_NO_RVALUE_REFERENCES)
 # include <boost/call_traits.hpp>
 #endif
-#include <boost/utility/enable_if.hpp>
 
 #include <boost/fusion/view/single_view/detail/single_view_fwd.hpp>
 #include <boost/fusion/view/single_view/detail/at_impl.hpp>
@@ -78,27 +78,14 @@
           : val()
         {}
 
-#ifdef BOOST_NO_VARIADIC_TEMPLATES
-# ifdef BOOST_NO_RVALUE_REFERENCES
+#if defined(BOOST_NO_VARIADIC_TEMPLATES) && defined(BOOST_NO_RVALUE_REFERENCES)
         explicit
         single_view(typename call_traits<T>::param_type val)
           : val(val)
         {}
-# else
- template<typename Arg>
- explicit
- single_view(Arg&& val
- , typename enable_if<
- detail::is_explicitly_convertible<
- BOOST_FUSION_R_ELSE_CLREF(Arg)
- , value_type
- >
- >::type* =0)
- : val(std::forward<Arg>(val))
- {}
-# endif
 #else
         template<typename Arg>
+ explicit
         single_view(BOOST_FUSION_R_ELSE_CLREF(Arg) arg
           , typename enable_if<
                 detail::is_explicitly_convertible<
@@ -108,8 +95,11 @@
>::type* =0)
           : val(BOOST_FUSION_FORWARD(Arg,arg))
         {}
+#endif
 
+#ifndef BOOST_NO_VARIADIC_TEMPLATES
         template<typename Arg1, typename Arg2, typename... Args>
+ explicit
         single_view(BOOST_FUSION_R_ELSE_CLREF(Arg1) arg1
           , BOOST_FUSION_R_ELSE_CLREF(Arg2) arg2
           , BOOST_FUSION_R_ELSE_CLREF(Args)... args)
@@ -142,7 +132,8 @@
             BOOST_FUSION_STATIC_ASSERT((result_of::size<SeqRef>::value==1));\
         }
 
- BOOST_FUSION_ALL_CTOR_COMBINATIONS(BOOST_FUSION_SINGLE_VIEW_ASSIGN_CTOR,_)
+ BOOST_FUSION_ALL_CTOR_COMBINATIONS(
+ BOOST_FUSION_SINGLE_VIEW_ASSIGN_CTOR,_)
 
 #undef BOOST_FUSION_SINGLE_VIEW_ASSIGN_CTOR
 

Modified: sandbox/SOC/2009/fusion/boost/fusion/view/transform_view/transform_view.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/view/transform_view/transform_view.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/view/transform_view/transform_view.hpp 2010-06-13 12:50:06 EDT (Sun, 13 Jun 2010)
@@ -109,6 +109,7 @@
         {}
 
 #ifdef BOOST_NO_RVALUE_REFERENCES
+ explicit
         transform_view(typename storage1_type::call_param seq1,
                 typename storage2_type::call_param seq2,
                 typename call_traits<F>::param_type f)
@@ -118,6 +119,7 @@
         {}
 #else
         template<typename OtherSeq1, typename OtherSeq2,typename OtherF>
+ explicit
         transform_view(BOOST_FUSION_R_ELSE_CLREF(OtherSeq1) seq1,
                 BOOST_FUSION_R_ELSE_CLREF(OtherSeq2) seq2,
                 BOOST_FUSION_R_ELSE_CLREF(OtherF) f)
@@ -187,6 +189,7 @@
         {}
 
 #ifdef BOOST_NO_RVALUE_REFERENCES
+ explicit
         unary_transform_view(
             typename storage_type::call_param seq,
             typename call_traits<transform_type>::param_type f)
@@ -195,6 +198,7 @@
         {}
 #else
         template<typename OtherSeq, typename OtherF>
+ explicit
         unary_transform_view(OtherSeq&& seq,OtherF&& f)
           : seq(std::forward<OtherSeq>(seq))
           , f(std::forward<OtherF>(f))
@@ -216,7 +220,7 @@
         transform_type f;
     };
 
- //TODO cschmidt: template typedef
+ //cschmidt: template aliases if possible...
     template<typename Seq, typename F>
     struct transform_view<Seq, F, mpl::true_,mpl::false_>
       : unary_transform_view<Seq, F, mpl::true_>
@@ -229,6 +233,7 @@
         {}
 
 #ifdef BOOST_NO_RVALUE_REFERENCES
+ explicit
         transform_view(
             typename base::storage_type::call_param seq,
             typename call_traits<typename base::transform_type>::param_type f)
@@ -236,6 +241,7 @@
         {}
 #else
         template<typename OtherSeq, typename OtherF>
+ explicit
         transform_view(OtherSeq&& seq,OtherF&& f)
           : base(std::forward<OtherSeq>(seq),std::forward<OtherF>(f))
         {}
@@ -262,6 +268,7 @@
         {}
 
 #ifdef BOOST_NO_RVALUE_REFERENCES
+ explicit
         transform_view(
             typename base::storage_type::call_param seq,
             typename call_traits<typename base::transform_type>::param_type f)
@@ -269,6 +276,7 @@
         {}
 #else
         template<typename OtherSeq, typename OtherF>
+ explicit
         transform_view(OtherSeq&& seq,OtherF&& f)
           : base(std::forward<OtherSeq>(seq),std::forward<OtherF>(f))
         {}

Modified: sandbox/SOC/2009/fusion/boost/fusion/view/zip_view/zip_view.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/view/zip_view/zip_view.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/view/zip_view/zip_view.hpp 2010-06-13 12:50:06 EDT (Sun, 13 Jun 2010)
@@ -37,7 +37,6 @@
 #include <boost/fusion/view/zip_view/detail/at_impl.hpp>
 #include <boost/fusion/view/zip_view/detail/value_at_impl.hpp>
 #include <boost/fusion/view/zip_view/detail/zip_view_iterator.hpp>
-
 #include <boost/fusion/view/zip_view/detail/begin_impl.hpp>
 #include <boost/fusion/view/zip_view/detail/end_impl.hpp>
 #include <boost/fusion/view/zip_view/detail/deref_impl.hpp>

Modified: sandbox/SOC/2009/fusion/boost/proto/fusion.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/proto/fusion.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/proto/fusion.hpp 2010-06-13 12:50:06 EDT (Sun, 13 Jun 2010)
@@ -29,6 +29,7 @@
 #include <boost/proto/proto_fwd.hpp>
 #include <boost/proto/traits.hpp>
 #include <boost/proto/eval.hpp>
+#include <boost/type_traits/remove_const.hpp>
 
 #if BOOST_MSVC
 #pragma warning(push)
@@ -53,11 +54,11 @@
             typedef fusion::random_access_traversal_tag category;
             typedef tag::proto_expr_iterator fusion_tag;
 
- expr_iterator(Expr const &e)
+ expr_iterator(Expr &e)
               : expr(e)
             {}
 
- Expr const &expr;
+ Expr &expr;
         };
 
         template<typename Expr>
@@ -203,7 +204,9 @@
             typename fusion::result_of::pop_front<Expr>::type
             operator ()(Expr &e) const
             {
- return fusion::pop_front(e);
+ // Work around a const-correctness issue in Fusion
+ typedef typename fusion::result_of::pop_front<Expr>::type result_type;
+ return result_type(fusion::next(fusion::begin(e)), fusion::end(e));
             }
 
             template<typename Expr>
@@ -243,7 +246,9 @@
             typename fusion::result_of::reverse<Expr>::type
             operator ()(Expr &e) const
             {
- return fusion::reverse(e);
+ // Work around a const-correctness issue in Fusion
+ typedef typename fusion::result_of::reverse<Expr>::type result_type;
+ return result_type(e);
             }
 
             template<typename Expr>
@@ -371,21 +376,6 @@
         };
 
         template<typename Tag>
- struct equal_to_impl;
-
- template<>
- struct equal_to_impl<proto::tag::proto_expr_iterator>
- {
- template<class It1, class It2>
- class apply
- : public is_same<
- typename remove_const<typename remove_reference<It1>::type>::type
- , typename remove_const<typename remove_reference<It2>::type>::type
- >
- {};
- };
-
- template<typename Tag>
         struct value_of_impl;
 
         template<>
@@ -393,13 +383,11 @@
         {
             template<
                 typename Iterator
- , long Arity = proto::arity_of<typename remove_reference<Iterator>::type::expr_type>::value
+ , long Arity = proto::arity_of<typename fusion::detail::remove_reference<Iterator>::type::expr_type>::value
>
             struct apply
             {
-
- typedef typename detail::remove_reference<Iterator>::type it;
-
+ typedef typename fusion::detail::remove_reference<Iterator>::type it;
                 typedef
                     typename proto::result_of::child_c<
                         typename it::expr_type
@@ -411,11 +399,9 @@
             template<typename Iterator>
             struct apply<Iterator, 0>
             {
- typedef typename detail::remove_reference<Iterator>::type it;
-
                 typedef
                     typename proto::result_of::value<
- typename it::expr_type
+ typename fusion::detail::remove_reference<Iterator>::type::expr_type
>::value_type
                 type;
             };
@@ -429,15 +415,14 @@
         {
             template<
                 typename Iterator
- , long Arity = proto::arity_of<typename remove_reference<Iterator>::type::expr_type>::value
+ , long Arity = proto::arity_of<typename fusion::detail::remove_reference<Iterator>::type::expr_type>::value
>
             struct apply
             {
- typedef typename detail::remove_reference<Iterator>::type it;
-
+ typedef typename fusion::detail::remove_reference<Iterator>::type it;
                 typedef
                     typename proto::result_of::child_c<
- typename it::expr_type const &
+ typename it::expr_type &
                       , it::index
>::type
                 type;
@@ -451,11 +436,9 @@
             template<typename Iterator>
             struct apply<Iterator, 0>
             {
- typedef typename detail::remove_reference<Iterator>::type it;
-
                 typedef
                     typename proto::result_of::value<
- typename it::expr_type const &
+ typename fusion::detail::remove_reference<Iterator>::type::expr_type &
>::type
                 type;
 
@@ -475,8 +458,7 @@
             template<typename Iterator, typename N>
             struct apply
             {
- typedef typename detail::remove_reference<Iterator>::type it;
-
+ typedef typename fusion::detail::remove_reference<Iterator>::type it;
                 typedef
                     typename proto::detail::expr_iterator<
                         typename it::expr_type
@@ -499,7 +481,7 @@
         {
             template<typename IteratorFrom, typename IteratorTo>
             struct apply
- : mpl::long_<remove_reference<IteratorTo>::type::index - remove_reference<IteratorFrom>::type::index>
+ : mpl::long_<fusion::detail::remove_reference<IteratorTo>::type::index - fusion::detail::remove_reference<IteratorFrom>::type::index>
             {};
         };
 
@@ -528,6 +510,21 @@
         };
 
         template<typename Tag>
+ struct equal_to_impl;
+
+ template<>
+ struct equal_to_impl<proto::tag::proto_expr_iterator>
+ {
+ template<class It1, class It2>
+ class apply
+ : public is_same<
+ typename remove_const<typename fusion::detail::remove_reference<It1>::type>::type
+ , typename remove_const<typename fusion::detail::remove_reference<It2>::type>::type
+ >
+ {};
+ };
+
+ template<typename Tag>
         struct category_of_impl;
 
         template<>
@@ -548,11 +545,8 @@
         {
             template<typename Sequence>
             struct apply
- {
- typedef typename detail::remove_reference<Sequence>::type seq;
-
- typedef mpl::long_<0 == seq::proto_arity_c ? 1 : seq::proto_arity_c> type;
- };
+ : mpl::long_<0 == fusion::detail::remove_reference<Sequence>::type::proto_arity_c ? 1 : fusion::detail::remove_reference<Sequence>::type::proto_arity_c>
+ {};
         };
 
         template<typename Tag>
@@ -564,8 +558,7 @@
             template<typename Sequence>
             struct apply
             {
- typedef typename detail::remove_reference<Sequence>::type seq;
- typedef proto::detail::expr_iterator<seq, 0> type;
+ typedef proto::detail::expr_iterator<typename fusion::detail::remove_reference<Sequence>::type, 0> type;
 
                 static type call(Sequence seq)
                 {
@@ -583,8 +576,7 @@
             template<typename Sequence>
             struct apply
             {
- typedef typename detail::remove_reference<Sequence>::type seq;
-
+ typedef typename fusion::detail::remove_reference<Sequence>::type seq;
                 typedef
                     proto::detail::expr_iterator<
                         seq
@@ -608,15 +600,13 @@
             template<
                 typename Sequence
               , typename Index
- , long Arity = proto::arity_of<typename remove_reference<Sequence>::type>::value
+ , long Arity = proto::arity_of<typename fusion::detail::remove_reference<Sequence>::type>::value
>
             struct apply
             {
- typedef typename detail::remove_reference<Sequence>::type seq;
-
                 typedef
                     typename proto::result_of::child_c<
- seq
+ typename fusion::detail::remove_reference<Sequence>::type
                       , Index::value
>::value_type
                 type;
@@ -625,11 +615,9 @@
             template<typename Sequence, typename Index>
             struct apply<Sequence, Index, 0>
             {
- typedef typename detail::remove_reference<Sequence>::type seq;
-
                 typedef
                     typename proto::result_of::value<
- seq
+ typename fusion::detail::remove_reference<Sequence>::type
>::value_type
                 type;
             };
@@ -644,18 +632,18 @@
             template<
                 typename Sequence
               , typename Index
- , long Arity = proto::arity_of<Sequence>::value
+ , long Arity = proto::arity_of<typename fusion::detail::remove_reference<Sequence>::type>::value
>
             struct apply
             {
                 typedef
                     typename proto::result_of::child_c<
- Sequence &
+ Sequence
                       , Index::value
>::type
                 type;
 
- static type call(Sequence &seq)
+ static type call(Sequence seq)
                 {
                     return proto::child_c<Index::value>(seq);
                 }
@@ -666,7 +654,7 @@
             {
                 typedef
                     typename proto::result_of::value<
- Sequence
+ typename fusion::detail::remove_reference<Sequence>::type
>::type
                 type;
 
@@ -698,14 +686,15 @@
             template<typename Sequence>
             struct apply
             {
- typedef typename Sequence::proto_tag proto_tag;
+ typedef typename fusion::detail::remove_reference<Sequence>::type seq;
+ typedef typename seq::proto_tag proto_tag;
 
                 typedef fusion::transform_view<
- typename Sequence::expr_type
+ typename seq::expr_type
                   , proto::detail::as_element<proto_tag>
> type;
 
- static type call(Sequence &sequence)
+ static type call(Sequence sequence)
                 {
                     return type(sequence.expr_, proto::detail::as_element<proto_tag>());
                 }
@@ -748,7 +737,9 @@
               : fusion::result_of::segmented_size<typename fusion::detail::remove_reference<Sequence>::type>
             {};
         };
+
     }
+
 }}
 
 namespace boost { namespace mpl

Modified: sandbox/SOC/2009/fusion/boost/proto/transform/fold.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/proto/transform/fold.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/proto/transform/fold.hpp 2010-06-13 12:50:06 EDT (Sun, 13 Jun 2010)
@@ -40,7 +40,7 @@
                 struct result<This(State, Expr)>
                 {
                     typedef
- typename when<_, Transform>::template impl<Expr, State, Data>::result_type
+ typename when<_, Transform>::template impl<Expr, typename fusion::detail::remove_reference<State>::type, Data>::result_type
                     type;
                 };
 

Modified: sandbox/SOC/2009/fusion/libs/fusion/test/suite1/sequence/filter_view.cpp
==============================================================================
--- sandbox/SOC/2009/fusion/libs/fusion/test/suite1/sequence/filter_view.cpp (original)
+++ sandbox/SOC/2009/fusion/libs/fusion/test/suite1/sequence/filter_view.cpp 2010-06-13 12:50:06 EDT (Sun, 13 Jun 2010)
@@ -51,6 +51,14 @@
     {};
 };
 
+struct less_pred_metafunction
+{
+ template<typename Arg>
+ struct apply
+ : boost::mpl::less<Arg, boost::mpl::int_<3> >
+ {};
+};
+
 int
 main()
 {
@@ -59,7 +67,7 @@
     using boost::mpl::int_;
     using boost::mpl::_;
     using boost::mpl::not_;
- using boost::mpl::less;
+ using boost::mpl::false_;
     using boost::mpl::vector_c;
     using boost::is_class;
     using boost::is_same;
@@ -81,20 +89,14 @@
     }
 
     {
- // $$$ JDG $$$ For some obscure reason, EDG based compilers
- // (e.g. comeau 4.3.3, intel) have problems with this.
- // vc7.1 and g++ are ok. The errors from comeau are useless.
-
-#ifndef __EDG_VERSION__
+ //TODO
         typedef vector_c<int, 5, 1, 2, 3, 6, 0, -1> vector_type;
- typedef filter_view<vector_type const, less<_, int_<3> > > filter_view_type;
+ typedef filter_view<vector_type const, less_pred_metafunction, false_> filter_view_type;
         vector_type v;
         filter_view_type view(v);
- //TODO!!!
- //std::cout << view << std::endl;
- //BOOST_TEST((view == make_vector(1, 2, 0, -1)));
- //BOOST_STATIC_ASSERT(result_of::size<filter_view_type>::value == 4);
-#endif
+ std::cout << view << std::endl;
+ BOOST_TEST((view == make_vector(1, 2, 0, -1)));
+ BOOST_STATIC_ASSERT(result_of::size<filter_view_type>::value == 4);
     }
 
     {


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