diff options
author | Anas Nashif <anas.nashif@intel.com> | 2013-08-26 08:15:55 -0400 |
---|---|---|
committer | Anas Nashif <anas.nashif@intel.com> | 2013-08-26 08:15:55 -0400 |
commit | bb4dd8289b351fae6b55e303f189127a394a1edd (patch) | |
tree | 77c9c35a31b1459dd7988c2448e797d142530c41 /boost/fusion/algorithm/iteration/accumulate.hpp | |
parent | 1a78a62555be32868418fe52f8e330c9d0f95d5a (diff) | |
download | boost-bb4dd8289b351fae6b55e303f189127a394a1edd.tar.gz boost-bb4dd8289b351fae6b55e303f189127a394a1edd.tar.bz2 boost-bb4dd8289b351fae6b55e303f189127a394a1edd.zip |
Imported Upstream version 1.51.0upstream/1.51.0
Diffstat (limited to 'boost/fusion/algorithm/iteration/accumulate.hpp')
-rw-r--r-- | boost/fusion/algorithm/iteration/accumulate.hpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/boost/fusion/algorithm/iteration/accumulate.hpp b/boost/fusion/algorithm/iteration/accumulate.hpp index a8d6a357a2..4b676dea6a 100644 --- a/boost/fusion/algorithm/iteration/accumulate.hpp +++ b/boost/fusion/algorithm/iteration/accumulate.hpp @@ -9,6 +9,8 @@ #include <boost/fusion/algorithm/iteration/accumulate_fwd.hpp> #include <boost/fusion/algorithm/iteration/fold.hpp> +#include <boost/fusion/support/is_sequence.hpp> +#include <boost/utility/enable_if.hpp> namespace boost { namespace fusion { @@ -23,14 +25,24 @@ namespace boost { namespace fusion } template <typename Sequence, typename State, typename F> - inline typename result_of::accumulate<Sequence, State const, F>::type + inline + typename + lazy_enable_if< + traits::is_sequence<Sequence> + , result_of::accumulate<Sequence, State const, F> + >::type accumulate(Sequence& seq, State const& state, F f) { return fusion::fold(seq, state, f); } template <typename Sequence, typename State, typename F> - inline typename result_of::accumulate<Sequence const, State const, F>::type + inline + typename + lazy_enable_if< + traits::is_sequence<Sequence> + , result_of::accumulate<Sequence const, State const, F> + >::type accumulate(Sequence const& seq, State const& state, F f) { return fusion::fold(seq, state, f); |