Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r71179 - trunk/boost/fusion/algorithm/iteration/detail
From: joel_at_[hidden]
Date: 2011-04-10 19:45:35


Author: djowel
Date: 2011-04-10 19:45:34 EDT (Sun, 10 Apr 2011)
New Revision: 71179
URL: http://svn.boost.org/trac/boost/changeset/71179

Log:
added version of fold (overload) accepting non-const State.
Text files modified:
   trunk/boost/fusion/algorithm/iteration/detail/fold.hpp | 32 ++++++++++++++++++++++++++++++--
   1 files changed, 30 insertions(+), 2 deletions(-)

Modified: trunk/boost/fusion/algorithm/iteration/detail/fold.hpp
==============================================================================
--- trunk/boost/fusion/algorithm/iteration/detail/fold.hpp (original)
+++ trunk/boost/fusion/algorithm/iteration/detail/fold.hpp 2011-04-10 19:45:34 EDT (Sun, 10 Apr 2011)
@@ -404,7 +404,7 @@
       , State const
       , F
>::type
- BOOST_FUSION_FOLD_NAME(Seq& seq,State const& state,F f)
+ BOOST_FUSION_FOLD_NAME(Seq& seq, State const& state, F f)
     {
         return result_of::BOOST_FUSION_FOLD_NAME<Seq,State const,F>::call(
             state,
@@ -418,13 +418,41 @@
       , State const
       , F
>::type
- BOOST_FUSION_FOLD_NAME(Seq const& seq,State const& state,F f)
+ BOOST_FUSION_FOLD_NAME(Seq const& seq, State const& state, F f)
     {
         return result_of::BOOST_FUSION_FOLD_NAME<Seq const,State const,F>::call(
             state,
             fusion::BOOST_FUSION_FOLD_IMPL_FIRST_IT_FUNCTION(seq),
             f);
     }
+
+ template<typename Seq, typename State, typename F>
+ inline typename result_of::BOOST_FUSION_FOLD_NAME<
+ Seq
+ , State const
+ , F
+ >::type
+ BOOST_FUSION_FOLD_NAME(Seq& seq, State& state, F f)
+ {
+ return result_of::BOOST_FUSION_FOLD_NAME<Seq,State,F>::call(
+ state,
+ fusion::BOOST_FUSION_FOLD_IMPL_FIRST_IT_FUNCTION(seq),
+ f);
+ }
+
+ template<typename Seq, typename State, typename F>
+ inline typename result_of::BOOST_FUSION_FOLD_NAME<
+ Seq const
+ , State const
+ , F
+ >::type
+ BOOST_FUSION_FOLD_NAME(Seq const& seq, State& state, F f)
+ {
+ return result_of::BOOST_FUSION_FOLD_NAME<Seq const,State,F>::call(
+ state,
+ fusion::BOOST_FUSION_FOLD_IMPL_FIRST_IT_FUNCTION(seq),
+ f);
+ }
 }}
 
 #undef BOOST_FUSION_FOLD_NAME


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