Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r56757 - in sandbox/SOC/2009/fusion: . boost/fusion/algorithm/iteration boost/fusion/algorithm/iteration/detail boost/fusion/algorithm/query libs/fusion/example/performance
From: mr.chr.schmidt_at_[hidden]
Date: 2009-10-12 16:43:54


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

Log:
fixes discrepancy between std::accumulate and fusion::accumulate (2)
Text files modified:
   sandbox/SOC/2009/fusion/boost/fusion/algorithm/iteration/detail/fold.hpp | 10 +++++-----
   sandbox/SOC/2009/fusion/boost/fusion/algorithm/iteration/fold.hpp | 4 ++--
   sandbox/SOC/2009/fusion/boost/fusion/algorithm/query/count_if.hpp | 2 +-
   sandbox/SOC/2009/fusion/libs/fusion/example/performance/accumulate.cpp | 2 +-
   sandbox/SOC/2009/fusion/libs/fusion/example/performance/inner_product2.cpp | 4 ++--
   sandbox/SOC/2009/fusion/project-root.jam | 4 ++--
   6 files changed, 13 insertions(+), 13 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:43:53 EDT (Mon, 12 Oct 2009)
@@ -46,7 +46,6 @@
             It3 it3 = fusion::next(it2);
 
             return unrolled_fold<Result,N-4>::call(
- fusion::next(it3),
                     f(
                         f(
                             f(
@@ -60,6 +59,7 @@
                         ),
                         fusion::deref(it3)
                     ),
+ fusion::next(it3),
                     BOOST_FUSION_FORWARD(F,f));
         }
     };
@@ -166,11 +166,11 @@
     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;
+ 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<it1, rest1, F>::type rest2;
+ 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<it2, rest2, F>::type rest3;
+ typedef typename fold_apply_rvalue_state<rest2, it2, F>::type rest3;
         typedef typename result_of::next<it2>::type it3;
 
         typedef typename
@@ -186,7 +186,7 @@
     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 fold_apply_rvalue_state<StateRef, It0, F>::type rest1;
         typedef typename result_of::next<It0>::type it1;
 
         typedef typename

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:43:53 EDT (Mon, 12 Oct 2009)
@@ -63,7 +63,7 @@
                 BOOST_FUSION_R_ELSE_CLREF(Seq)
               , BOOST_FUSION_R_ELSE_CLREF(State)
               , BOOST_FUSION_R_ELSE_CLREF(F)
- >::call(fusion::begin(BOOST_FUSION_FORWARD(Seq,seq)), state, f);
+ >::call(state, fusion::begin(BOOST_FUSION_FORWARD(Seq,seq)), f);
     }
 
 #ifdef BOOST_NO_RVALUE_REFERENCES
@@ -78,7 +78,7 @@
 # pragma warning(disable: 4180)
 #endif
         return result_of::fold<Seq&,State const&,F const&>::call(
- fusion::begin(seq), state, f);
+ state, fusion::begin(seq), f);
 #ifdef BOOST_MSVC
 # pragma warning(pop)
 #endif

Modified: sandbox/SOC/2009/fusion/boost/fusion/algorithm/query/count_if.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/algorithm/query/count_if.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/algorithm/query/count_if.hpp 2009-10-12 16:43:53 EDT (Mon, 12 Oct 2009)
@@ -29,7 +29,7 @@
 
             template<typename E>
             inline int
- operator()(BOOST_FUSION_R_ELSE_CLREF(E) e, int count)const
+ operator()(int count, BOOST_FUSION_R_ELSE_CLREF(E) e)const
             {
                 return f(BOOST_FUSION_FORWARD(E,e)) ? ++count : count;
             }

Modified: sandbox/SOC/2009/fusion/libs/fusion/example/performance/accumulate.cpp
==============================================================================
--- sandbox/SOC/2009/fusion/libs/fusion/example/performance/accumulate.cpp (original)
+++ sandbox/SOC/2009/fusion/libs/fusion/example/performance/accumulate.cpp 2009-10-12 16:43:53 EDT (Mon, 12 Oct 2009)
@@ -249,7 +249,7 @@
     {
         template<typename Lhs, typename Rhs>
         struct result
- : boost::fusion::detail::remove_reference<Rhs>
+ : boost::fusion::detail::remove_reference<Lhs>
         {};
         
         template<typename Lhs, typename Rhs>

Modified: sandbox/SOC/2009/fusion/libs/fusion/example/performance/inner_product2.cpp
==============================================================================
--- sandbox/SOC/2009/fusion/libs/fusion/example/performance/inner_product2.cpp (original)
+++ sandbox/SOC/2009/fusion/libs/fusion/example/performance/inner_product2.cpp 2009-10-12 16:43:53 EDT (Mon, 12 Oct 2009)
@@ -121,14 +121,14 @@
 
         template<typename Self,typename Lhs, typename Rhs>
         struct result<Self(Lhs, Rhs)>
- : boost::fusion::detail::remove_reference<Rhs>
+ : boost::fusion::detail::remove_reference<Lhs>
         {};
         
         template<typename Lhs, typename Rhs>
         typename result<poly_combine(Lhs,Rhs)>::type
         operator()(const Lhs& lhs, const Rhs& rhs) const
         {
- return rhs + boost::fusion::at_c<0>(lhs) * boost::fusion::at_c<1>(lhs);
+ return lhs + boost::fusion::at_c<0>(rhs) * boost::fusion::at_c<1>(rhs);
         }
     };
 

Modified: sandbox/SOC/2009/fusion/project-root.jam
==============================================================================
--- sandbox/SOC/2009/fusion/project-root.jam (original)
+++ sandbox/SOC/2009/fusion/project-root.jam 2009-10-12 16:43:53 EDT (Mon, 12 Oct 2009)
@@ -23,5 +23,5 @@
 
 #build-project libs/fusion/doc ;
 #build-project libs/fusion/example/extension ;
-#build-project libs/fusion/example/performance ;
-#build-project libs/fusion/test ;
\ No newline at end of file
+build-project libs/fusion/example/performance ;
+build-project libs/fusion/test ;
\ No newline at end of file


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