Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r56753 - in sandbox/SOC/2009/fusion: . boost/fusion/algorithm/iteration boost/fusion/algorithm/iteration/detail boost/fusion/container/generation/detail/variadic_templates boost/fusion/view/detail libs/fusion/doc libs/fusion/example/performance libs/fusion/test/algorithm libs/fusion/test/compile_time libs/fusion/test/functional
From: mr.chr.schmidt_at_[hidden]
Date: 2009-10-12 16:17:04


Author: cschmidt
Date: 2009-10-12 16:17:02 EDT (Mon, 12 Oct 2009)
New Revision: 56753
URL: http://svn.boost.org/trac/boost/changeset/56753

Log:
fixes discrepancy between std::accumulate and fusion::accumulate

Text files modified:
   sandbox/SOC/2009/fusion/boost/fusion/algorithm/iteration/detail/fold.hpp | 138 +++++++++++++++++++++------------------
   sandbox/SOC/2009/fusion/boost/fusion/algorithm/iteration/fold.hpp | 2
   sandbox/SOC/2009/fusion/boost/fusion/container/generation/detail/variadic_templates/make_map.hpp | 1
   sandbox/SOC/2009/fusion/boost/fusion/container/generation/detail/variadic_templates/map_tie.hpp | 1
   sandbox/SOC/2009/fusion/boost/fusion/view/detail/strictest_traversal.hpp | 4
   sandbox/SOC/2009/fusion/build.bat | 2
   sandbox/SOC/2009/fusion/libs/fusion/doc/algorithm.qbk | 20 ++--
   sandbox/SOC/2009/fusion/libs/fusion/example/performance/functional.cpp | 4
   sandbox/SOC/2009/fusion/libs/fusion/test/algorithm/fold.cpp | 32 ++++----
   sandbox/SOC/2009/fusion/libs/fusion/test/compile_time/fold.cpp | 6
   sandbox/SOC/2009/fusion/libs/fusion/test/functional/make_unfused.cpp | 2
   sandbox/SOC/2009/fusion/libs/fusion/test/functional/unfused.cpp | 2
   sandbox/SOC/2009/fusion/libs/fusion/test/functional/unfused_typed.cpp | 4
   13 files changed, 112 insertions(+), 106 deletions(-)

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 2009-10-12 16:17:02 EDT (Mon, 12 Oct 2009)
@@ -32,10 +32,10 @@
     template<typename Result,int N>
     struct unrolled_fold
     {
- template<typename It0, typename State, typename F>
+ template<typename State, typename It0, typename F>
         static Result
- call(It0 const& it0,
- BOOST_FUSION_R_ELSE_CLREF(State) state,
+ call(BOOST_FUSION_R_ELSE_CLREF(State) state,
+ It0 const& it0,
                 BOOST_FUSION_R_ELSE_CLREF(F) f)
         {
             typedef typename result_of::next<It0 const&>::type It1;
@@ -47,14 +47,18 @@
 
             return unrolled_fold<Result,N-4>::call(
                     fusion::next(it3),
- f(fusion::deref(it3),
- f(fusion::deref(it2),
- f(fusion::deref(it1),
- f(fusion::deref(it0),
- BOOST_FUSION_FORWARD(State,state)
- )
- )
- )
+ f(
+ f(
+ f(
+ f(
+ BOOST_FUSION_FORWARD(State,state),
+ fusion::deref(it0)
+ ),
+ fusion::deref(it1)
+ ),
+ fusion::deref(it2)
+ ),
+ fusion::deref(it3)
                     ),
                     BOOST_FUSION_FORWARD(F,f));
         }
@@ -63,10 +67,10 @@
     template<typename Result>
     struct unrolled_fold<Result,3>
     {
- template<typename It0, typename State, typename F>
+ template<typename State, typename It0, typename F>
         static Result
- call(It0 const& it0,
- BOOST_FUSION_R_ELSE_CLREF(State) state,
+ call(BOOST_FUSION_R_ELSE_CLREF(State) state,
+ It0 const& it0,
                 BOOST_FUSION_R_ELSE_CLREF(F) f)
         {
             typedef typename result_of::next<It0 const&>::type It1;
@@ -74,13 +78,15 @@
             typedef typename result_of::next<It1&>::type It2;
             It2 it2 = fusion::next(it1);
 
- return f(fusion::deref(fusion::next(it1)),
- f(fusion::deref(it1),
+ return f(
+ f(
                             f(
- fusion::deref(it0),
- BOOST_FUSION_FORWARD(State,state)
- )
- )
+ BOOST_FUSION_FORWARD(State,state),
+ fusion::deref(it0)
+ ),
+ fusion::deref(it1)
+ ),
+ fusion::deref(fusion::next(it1))
                     );
         }
     };
@@ -88,47 +94,49 @@
     template<typename Result>
     struct unrolled_fold<Result,2>
     {
- template<typename It0, typename State, typename F>
+ template<typename State, typename It0, typename F>
         static Result
- call(It0 const& it0,
- BOOST_FUSION_R_ELSE_CLREF(State) state,
+ call(BOOST_FUSION_R_ELSE_CLREF(State) state,
+ It0 const& it0,
                 BOOST_FUSION_R_ELSE_CLREF(F) f)
         {
- return f(fusion::deref(fusion::next(it0)),
- f(fusion::deref(it0),BOOST_FUSION_FORWARD(State,state)));
+ return f(
+ f(BOOST_FUSION_FORWARD(State,state),fusion::deref(it0)),
+ fusion::deref(fusion::next(it0)));
         }
     };
 
     template<typename Result>
     struct unrolled_fold<Result,1>
     {
- template<typename It0, typename State, typename F>
+ template<typename State, typename It0, typename F>
         static Result
- call(It0 const& it0,
- BOOST_FUSION_R_ELSE_CLREF(State) state,
+ call(BOOST_FUSION_R_ELSE_CLREF(State) state,
+ It0 const& it0,
                 BOOST_FUSION_R_ELSE_CLREF(F) f)
         {
- return f(fusion::deref(it0), BOOST_FUSION_FORWARD(State,state));
+ return f(BOOST_FUSION_FORWARD(State,state),fusion::deref(it0));
         }
     };
 
     template<typename Result>
     struct unrolled_fold<Result,0>
     {
- template<typename It0, typename State, typename F>
+ template<typename State, typename It0, typename F>
         static Result
- call(It0 const&,
- BOOST_FUSION_R_ELSE_CLREF(State) state,
+ call(BOOST_FUSION_R_ELSE_CLREF(State) state,
+ It0 const&,
                 BOOST_FUSION_R_ELSE_CLREF(F))
         {
             return state;
         }
     };
 
- template <typename It, typename StateRef, typename F>
+ 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<
@@ -138,24 +146,24 @@
 #else
             typename result_of::deref<It>::type&&
 #endif
- , StateRef)
+ )
>
     {};
 
- template<typename It, typename State, typename F>
+ template<typename State, typename It, typename F>
     struct fold_apply_rvalue_state
       : fold_apply<
- It
 #ifdef BOOST_NO_RVALUE_REFERENCES
- , typename add_lref<typename add_const<State>::type>::type
+ typename add_lref<typename add_const<State>::type>::type
 #else
- , State&&
+ State&&
 #endif
+ , It
           , F
>
     {};
 
- template<typename It0, typename StateRef, typename F, int N>
+ template<typename StateRef, typename It0, typename F, int N>
     struct result_of_unrolled_fold
     {
         typedef typename fold_apply_rvalue_state<It0, StateRef, F>::type rest1;
@@ -167,65 +175,65 @@
 
         typedef typename
             result_of_unrolled_fold<
- typename result_of::next<it3>::type
- , typename fold_apply_rvalue_state<it3, rest3, F>::type
+ typename fold_apply_rvalue_state<rest3, it3, F>::type
+ , typename result_of::next<it3>::type
               , F
               , N-4
>::type
         type;
     };
 
- template<typename It0, typename StateRef, typename F>
- struct result_of_unrolled_fold<It0, StateRef, F, 3>
+ template<typename StateRef, typename It0, typename F>
+ struct result_of_unrolled_fold<StateRef, It0, F, 3>
     {
         typedef typename fold_apply_rvalue_state<It0, StateRef, F>::type rest1;
         typedef typename result_of::next<It0>::type it1;
 
         typedef typename
             fold_apply_rvalue_state<
- typename result_of::next<it1>::type
- , typename fold_apply_rvalue_state<it1, rest1, F>::type
+ typename fold_apply_rvalue_state<rest1, it1, F>::type
+ , typename result_of::next<it1>::type
               , F
>::type
         type;
     };
 
- template<typename It0, typename StateRef, typename F>
- struct result_of_unrolled_fold<It0, StateRef, F, 2>
+ template<typename StateRef, typename It0, typename F>
+ struct result_of_unrolled_fold<StateRef, It0, F, 2>
       : fold_apply_rvalue_state<
- typename result_of::next<It0>::type
- , typename fold_apply_rvalue_state<It0, StateRef, F>::type
+ typename fold_apply_rvalue_state<StateRef, It0, F>::type
+ , typename result_of::next<It0>::type
           , F
>
     {};
 
- template<typename It0, typename StateRef, typename F>
- struct result_of_unrolled_fold<It0, StateRef, F, 1>
- : fold_apply_rvalue_state<It0, StateRef, 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 It0, typename StateRef, typename F>
- struct result_of_unrolled_fold<It0, StateRef, F, 0>
+ template<typename StateRef, typename It0, typename F>
+ struct result_of_unrolled_fold<StateRef, It0, F, 0>
     {
         typedef StateRef type;
     };
 
- template<typename It0, typename StateRef, typename FRef, int SeqSize>
+ template<typename StateRef, typename It0, typename FRef, int SeqSize>
     struct result_of_unrolled_fold_first
     {
         typedef typename get_func_base<FRef>::type f;
 
         typedef typename
             result_of_unrolled_fold<
- typename result_of::next<It0>::type
- , typename fold_apply<It0, StateRef, f>::type
+ typename fold_apply<StateRef, It0, f>::type
+ , typename result_of::next<It0>::type
               , f
               , SeqSize-1
>::type
         type;
     };
 
- template<int SeqSize, typename It0, typename StateRef, typename FRef>
+ template<int SeqSize, typename StateRef, typename It0, typename FRef>
     struct fold_impl
     {
         typedef preevaluate<FRef> preevaluater;
@@ -235,8 +243,8 @@
                 typename preevaluater::is_preevaluable
               , preevaluater
               , result_of_unrolled_fold_first<
- It0
- , StateRef
+ StateRef
+ , It0
                   , FRef
                   , SeqSize
>
@@ -244,22 +252,22 @@
         type;
 
         static type
- call(It0 const& it0, StateRef state, FRef f)
+ call(StateRef state, It0 const& it0, FRef f)
         {
             return unrolled_fold<type, SeqSize>::call(
- it0,
                     BOOST_FUSION_FORWARD(StateRef,state),
+ it0,
                     BOOST_FUSION_FORWARD(FRef,f));
         }
     };
 
- template<typename It0, typename StateRef, typename FRef>
- struct fold_impl<0,It0,StateRef,FRef>
+ template<typename StateRef, typename It0, typename FRef>
+ struct fold_impl<0,StateRef,It0,FRef>
     {
         typedef StateRef type;
 
         static StateRef
- call(It0 const&, StateRef state, FRef)
+ call(StateRef state, It0 const&, FRef)
         {
             return state;
         }

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 2009-10-12 16:17:02 EDT (Mon, 12 Oct 2009)
@@ -29,7 +29,6 @@
         struct fold
           : detail::fold_impl<
                 size<Seq>::value
- , typename begin<Seq>::type
               , typename detail::add_lref<
 #ifdef BOOST_NO_RVALUE_REFERENCES
                     typename add_const<
@@ -39,6 +38,7 @@
>::type
 #endif
>::type
+ , typename begin<Seq>::type
               , typename detail::add_lref<F>::type
>
         {

Modified: sandbox/SOC/2009/fusion/boost/fusion/container/generation/detail/variadic_templates/make_map.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/container/generation/detail/variadic_templates/make_map.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/container/generation/detail/variadic_templates/make_map.hpp 2009-10-12 16:17:02 EDT (Mon, 12 Oct 2009)
@@ -15,7 +15,6 @@
 
 #include <boost/mpl/int.hpp>
 #include <boost/mpl/divides.hpp>
-#include <boost/mpl/fold.hpp>
 #include <boost/mpl/begin.hpp>
 #include <boost/mpl/advance.hpp>
 #include <boost/mpl/end.hpp>

Modified: sandbox/SOC/2009/fusion/boost/fusion/container/generation/detail/variadic_templates/map_tie.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/container/generation/detail/variadic_templates/map_tie.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/container/generation/detail/variadic_templates/map_tie.hpp 2009-10-12 16:17:02 EDT (Mon, 12 Oct 2009)
@@ -15,7 +15,6 @@
 
 #include <boost/mpl/int.hpp>
 #include <boost/mpl/divides.hpp>
-#include <boost/mpl/fold.hpp>
 #include <boost/mpl/begin.hpp>
 #include <boost/mpl/advance.hpp>
 #include <boost/mpl/end.hpp>

Modified: sandbox/SOC/2009/fusion/boost/fusion/view/detail/strictest_traversal.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/view/detail/strictest_traversal.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/view/detail/strictest_traversal.hpp 2009-10-12 16:17:02 EDT (Mon, 12 Oct 2009)
@@ -25,8 +25,8 @@
             template<typename Sig>
             struct result;
 
- template<typename Self, typename NextSeq, typename StrictestSoFar>
- struct result<Self(NextSeq, StrictestSoFar)>
+ template<typename Self, typename StrictestSoFar, typename NextSeq>
+ struct result<Self(StrictestSoFar, NextSeq)>
             {
                 typedef typename traits::category_of<NextSeq>::type next_tag;
                 typedef typename

Modified: sandbox/SOC/2009/fusion/build.bat
==============================================================================
--- sandbox/SOC/2009/fusion/build.bat (original)
+++ sandbox/SOC/2009/fusion/build.bat 2009-10-12 16:17:02 EDT (Mon, 12 Oct 2009)
@@ -32,7 +32,7 @@
 )
 
 rem compile...
-%BOOST_ROOT%\bjam -sHOME="z:\projekte\cl_link_frontend\util\boost" --toolset=%TOOLSET% %2 %3 %4 %5 %6 %7 %8 %9
+%BOOST_ROOT%\bjam -sHOME="Z:\projekte\infrastructure\util\boost" --toolset=%TOOLSET% %2 %3 %4 %5 %6 %7 %8 %9
 goto :eof
 
 :gcc3

Modified: sandbox/SOC/2009/fusion/libs/fusion/doc/algorithm.qbk
==============================================================================
--- sandbox/SOC/2009/fusion/libs/fusion/doc/algorithm.qbk (original)
+++ sandbox/SOC/2009/fusion/libs/fusion/doc/algorithm.qbk 2009-10-12 16:17:02 EDT (Mon, 12 Oct 2009)
@@ -62,7 +62,7 @@
 [section fold]
 
 [heading Description]
-For a sequence `Seq`, initial state, and binary function object or function pointer `f`, fold repeatedly applies binary `f` to each element of `Seq` and the previous state.
+For a sequence `Seq`, initial state, and binary function object or function pointer `f`, fold repeatedly applies binary `f` to the previous state and each element of `Seq`.
 
 [heading Synopsis]
     template<
@@ -75,9 +75,9 @@
 
 [table Parameters
     [[Parameter][Requirement][Description]]
- [[`seq`][A model of __forward_sequence__,`f(e,s)` must be a valid expression for each element `e` in `seq`, and current state `s`][Operation's argument]]
+ [[`seq`][A model of __forward_sequence__,`f(s,e)` must be a valid expression for current state `s`, and each element `e` in `seq`][Operation's argument]]
     [[`initial_state`][Any type][Initial state]]
- [[`f`][`__boost_result_of_call__<F(E,S)>::type` is the return type of `f(e,s)` for each element `e` of type `E` in `seq`, and current state `s` of type `S`][Operation's argument]]
+ [[`f`][`__boost_result_of_call__<F(S,E)>::type` is the return type of `f(s,e)` current state `s` of type `S`, and for each element `e` of type `E` in `seq`][Operation's argument]]
 ]
 
 [heading Expression Semantics]
@@ -85,7 +85,7 @@
 
 [*Return type]: Any type
 
-[*Semantics]: Equivalent to `f(eN ....f(e2,f(e1,initial_state)))` where `e1 ...eN` are the elements of `seq`.
+[*Semantics]: Equivalent to `f(f(f(initial_state,e1),e2) ....eN)` where `e1 ...eN` are the elements of `seq`.
 
 [heading Complexity]
 Linear, exactly `__result_of_size__<Sequence>::value` applications of `f`.
@@ -101,7 +101,7 @@
         typedef std::string result_type;
 
         template<typename T>
- std::string operator()(const T& t, const std::string& str) const
+ std::string operator()(const std::string& str, const T& t) const
         {
             return str + boost::lexical_cast<std::string>(t);
         }
@@ -115,7 +115,7 @@
 [section accumulate]
 
 [heading Description]
-For a sequence `Seq`, initial state, and binary function object or function pointer `f`, accumulate repeatedly applies binary `f` to each element of `Seq` and the previous state.
+For a sequence `Seq`, initial state, and binary function object or function pointer `f`, accumulate repeatedly applies binary `f` the previous state and to each element of `Seq`.
 
 [heading Synopsis]
     template<
@@ -128,9 +128,9 @@
 
 [table Parameters
     [[Parameter][Requirement][Description]]
- [[`seq`][A model of __forward_sequence__, `f(eN ....f(e2,f(e1,initial_state)))` must be a valid expression for each element `e1` to `eN` in `seq`][Operation's argument]]
+ [[`seq`][A model of __forward_sequence__, `f(f(f(initial_state,e1),e2) ....eN)` must be a valid expression for each element `e1` to `eN` in `seq`][Operation's argument]]
     [[`initial_state`][Any type][Initial state]]
- [[`f`][`__boost_result_of_call__<F(E,S)>::type` is the return type of `f(e,s)` for each element `e` of type `E` in `seq`, and current state `s` of type `S`][Operation's argument]]
+ [[`f`][`__boost_result_of_call__<F(S,E)>::type` is the return type of `f(s,e)` current state `s` of type `S` and for each element `e` of type `E` in `seq`][Operation's argument]]
 ]
 
 [heading Expression Semantics]
@@ -138,7 +138,7 @@
 
 [*Return type]: Any type
 
-[*Semantics]: Equivalent to `f(eN ....f(e2,f(e1,initial_state)))` where `e1 ...eN` are the elements of `seq`.
+[*Semantics]: Equivalent to `f(f(f(initial_state,e1),e2) ....eN)` where `e1 ...eN` are the elements of `seq`.
 
 [heading Complexity]
 Linear, exactly `__result_of_size__<Sequence>::value` applications of `f`.
@@ -154,7 +154,7 @@
         typedef std::string result_type;
 
         template<typename T>
- std::string operator()(const T& t, const std::string& str) const
+ std::string operator()(const std::string& str, const T& t) const
         {
             return str + boost::lexical_cast<std::string>(t);
         }

Modified: sandbox/SOC/2009/fusion/libs/fusion/example/performance/functional.cpp
==============================================================================
--- sandbox/SOC/2009/fusion/libs/fusion/example/performance/functional.cpp (original)
+++ sandbox/SOC/2009/fusion/libs/fusion/example/performance/functional.cpp 2009-10-12 16:17:02 EDT (Mon, 12 Oct 2009)
@@ -49,13 +49,13 @@
         struct sum_op
         {
             template <typename T>
- int operator()(T const& elem, int value) const
+ int operator()(int value, T const& elem) const
             {
               return value + sizeof(T) * elem;
             }
 
             template <typename T>
- int operator()(T & elem, int value) const
+ int operator()(int value, T & elem) const
             {
               elem += sizeof(T);
               return value;

Modified: sandbox/SOC/2009/fusion/libs/fusion/test/algorithm/fold.cpp
==============================================================================
--- sandbox/SOC/2009/fusion/libs/fusion/test/algorithm/fold.cpp (original)
+++ sandbox/SOC/2009/fusion/libs/fusion/test/algorithm/fold.cpp 2009-10-12 16:17:02 EDT (Mon, 12 Oct 2009)
@@ -34,25 +34,25 @@
     template<typename T>
     struct result;
 
- template <typename Self,typename T, typename State>
- struct result<Self(T,State)>
+ template <typename Self,typename State,typename T>
+ struct result<Self(State,T)>
     {
         //TODO cschmidt: remove_reference does not support rvalue refs yet,
         //therefore we use the internal function of fusion!
- typedef typename boost::fusion::detail::identity<State>::type type;
+ typedef typename boost::fusion::detail::identity<T>::type type;
         //typedef typename boost::remove_const<
         // typename boost::remove_reference<State>::type>::type type;
     };
 
- template <typename T, typename State>
+ template <typename State, typename T>
     State const&
- operator()(T const& x, State const& state) const
+ operator()(State const& state, T const& x) const
     {
         return state;
     }
 
     int
- operator()(int x, int state) const
+ operator()(int state, int x) const
     {
         return x + state;
     }
@@ -63,8 +63,8 @@
     template<typename T>
     struct result;
 
- template <typename Self,typename T, typename CountT>
- struct result<Self(T,CountT)>
+ template <typename Self,typename CountT,typename T>
+ struct result<Self(CountT, T)>
     {
         typedef typename boost::fusion::detail::identity<T>::type elem;
         typedef typename boost::fusion::detail::identity<CountT>::type state;
@@ -82,11 +82,11 @@
         type;
     };
 
- template <typename T, typename CountT>
- typename result<count_ints(T, CountT)>::type
- operator()(T const&, CountT const&) const
+ template <typename CountT, typename T>
+ typename result<count_ints(CountT, T)>::type
+ operator()(CountT const&, T const&) const
     {
- typedef typename result<count_ints(T, CountT)>::type result;
+ typedef typename result<count_ints(CountT, T)>::type result;
         return result();
     }
 };
@@ -95,7 +95,7 @@
 {
     typedef std::string result_type;
 
- std::string operator()(char c, std::string const& str) const
+ std::string operator()(std::string const& str, char c) const
     {
         return str + c;
     }
@@ -107,13 +107,13 @@
     struct result;
 
     template<typename Self,typename T0, typename T1>
- struct result<Self(T0&, T1)>
+ struct result<Self(T0, T1&)>
     {
- typedef T0 type;
+ typedef T1& type;
     };
 
     template<typename T0, typename T1>
- T0 operator()(T0& lhs, T1 const& rhs) const
+ T0 operator()(T0 const& lhs, T1& rhs) const
     {
         return lhs + rhs;
     }

Modified: sandbox/SOC/2009/fusion/libs/fusion/test/compile_time/fold.cpp
==============================================================================
--- sandbox/SOC/2009/fusion/libs/fusion/test/compile_time/fold.cpp (original)
+++ sandbox/SOC/2009/fusion/libs/fusion/test/compile_time/fold.cpp 2009-10-12 16:17:02 EDT (Mon, 12 Oct 2009)
@@ -23,8 +23,8 @@
     template<typename Sig>
     struct result;
 
- template<typename Self, typename D, typename State>
- struct result<Self(D,State)>
+ template<typename Self, typename State, typename D>
+ struct result<Self(State, D)>
     {
         typedef int type;
     };
@@ -33,7 +33,7 @@
 #endif
 
     template<int n, int batch>
- int operator()(distinct<n, batch> const& d, int state) const
+ int operator()(int state, distinct<n, batch> const& d) const
     {
       return state + n;
     }

Modified: sandbox/SOC/2009/fusion/libs/fusion/test/functional/make_unfused.cpp
==============================================================================
--- sandbox/SOC/2009/fusion/libs/fusion/test/functional/make_unfused.cpp (original)
+++ sandbox/SOC/2009/fusion/libs/fusion/test/functional/make_unfused.cpp 2009-10-12 16:17:02 EDT (Mon, 12 Oct 2009)
@@ -67,7 +67,7 @@
         typedef long result_type;
 
         template <typename T>
- long operator()(T & elem, long value) const
+ long operator()(long value, T & elem) const
         {
           elem += sizeof(T);
           return value + elem;

Modified: sandbox/SOC/2009/fusion/libs/fusion/test/functional/unfused.cpp
==============================================================================
--- sandbox/SOC/2009/fusion/libs/fusion/test/functional/unfused.cpp (original)
+++ sandbox/SOC/2009/fusion/libs/fusion/test/functional/unfused.cpp 2009-10-12 16:17:02 EDT (Mon, 12 Oct 2009)
@@ -58,7 +58,7 @@
         typedef long result_type;
 
         template <typename T>
- long operator()(T & elem, long value) const
+ long operator()(long value, T & elem) const
         {
           elem += sizeof(T);
           return value + elem;

Modified: sandbox/SOC/2009/fusion/libs/fusion/test/functional/unfused_typed.cpp
==============================================================================
--- sandbox/SOC/2009/fusion/libs/fusion/test/functional/unfused_typed.cpp (original)
+++ sandbox/SOC/2009/fusion/libs/fusion/test/functional/unfused_typed.cpp 2009-10-12 16:17:02 EDT (Mon, 12 Oct 2009)
@@ -63,13 +63,13 @@
         typedef long result_type;
 
         template <typename T>
- long operator()(T const& elem, long value) const
+ long operator()(long value, T const& elem) const
         {
           return value + sizeof(T) * elem;
         }
 
         template <typename T>
- long operator()(T & elem, long value) const
+ long operator()(long value, T & elem) const
         {
           elem += sizeof(T);
           return value;


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