diff --git a/doc/algorithm.qbk b/doc/algorithm.qbk index f47fce5c..975887a1 100644 --- a/doc/algorithm.qbk +++ b/doc/algorithm.qbk @@ -258,6 +258,22 @@ the first call) and [arg_desc] of `seq`. typename result_of_name_macro::type name_macro( Sequence const& seq, State const& initial_state, F f); + template< + typename Sequence, + typename State, + typename F + > + typename result_of_name_macro::type name_macro( + Sequence& seq, State& initial_state, F f); + + template< + typename Sequence, + typename State, + typename F + > + typename result_of_name_macro::type name_macro( + Sequence const& seq, State& initial_state, F f); + [def seq_concept_macro [seq_concept]] [def arg_type_id_macro [arg_type_id]] [def arg_id_macro [arg_id]] diff --git a/include/boost/fusion/algorithm/iteration/detail/fold.hpp b/include/boost/fusion/algorithm/iteration/detail/fold.hpp index 22cb6ecd..ddc4d0af 100644 --- a/include/boost/fusion/algorithm/iteration/detail/fold.hpp +++ b/include/boost/fusion/algorithm/iteration/detail/fold.hpp @@ -68,9 +68,7 @@ namespace boost { namespace fusion , typename result_of::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION::type , boost::result_of< F( - typename add_reference::type>::type, + typename add_reference::type, BOOST_FUSION_FOLD_IMPL_INVOKE_IT_META_TRANSFORM(It const) ) > @@ -108,9 +106,7 @@ namespace boost { namespace fusion typename result_of::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION::type , boost::result_of< F( - typename add_reference::type>::type, + typename add_reference::type, BOOST_FUSION_FOLD_IMPL_INVOKE_IT_META_TRANSFORM(It const) ) > @@ -136,7 +132,7 @@ namespace boost { namespace fusion , BOOST_FUSION_FOLD_IMPL_FIRST_IT_META_TRANSFORM( typename result_of::BOOST_FUSION_FOLD_IMPL_FIRST_IT_FUNCTION::type ) - , add_reference::type> + , add_reference , F > {}; @@ -150,7 +146,7 @@ namespace boost { namespace fusion BOOST_FUSION_FOLD_IMPL_FIRST_IT_META_TRANSFORM( typename result_of::BOOST_FUSION_FOLD_IMPL_FIRST_IT_FUNCTION::type ) - , add_reference::type> + , add_reference , F >( typename result_of::size::type() @@ -199,7 +195,7 @@ namespace boost { namespace fusion BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::BOOST_FUSION_FOLD_NAME< Seq - , State const + , State , F >::type BOOST_FUSION_FOLD_NAME(Seq& seq, State& state, F f) @@ -211,7 +207,7 @@ namespace boost { namespace fusion BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::BOOST_FUSION_FOLD_NAME< Seq const - , State const + , State , F >::type BOOST_FUSION_FOLD_NAME(Seq const& seq, State& state, F f) diff --git a/include/boost/fusion/algorithm/iteration/fold.hpp b/include/boost/fusion/algorithm/iteration/fold.hpp index 29748cd8..039e01c0 100644 --- a/include/boost/fusion/algorithm/iteration/fold.hpp +++ b/include/boost/fusion/algorithm/iteration/fold.hpp @@ -22,7 +22,6 @@ #include #include #include -#include #include #if !defined(BOOST_FUSION_DONT_USE_PREPROCESSED_FILES) diff --git a/include/boost/fusion/algorithm/iteration/fold_fwd.hpp b/include/boost/fusion/algorithm/iteration/fold_fwd.hpp index f8328e80..0dbac761 100644 --- a/include/boost/fusion/algorithm/iteration/fold_fwd.hpp +++ b/include/boost/fusion/algorithm/iteration/fold_fwd.hpp @@ -38,7 +38,7 @@ namespace boost { namespace fusion BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::fold< Seq - , State const + , State , F >::type fold(Seq& seq, State& state, F f); @@ -47,7 +47,7 @@ namespace boost { namespace fusion BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::fold< Seq const - , State const + , State , F >::type fold(Seq const& seq, State& state, F f); diff --git a/include/boost/fusion/algorithm/iteration/iter_fold.hpp b/include/boost/fusion/algorithm/iteration/iter_fold.hpp index 952466a1..cff5b4ed 100644 --- a/include/boost/fusion/algorithm/iteration/iter_fold.hpp +++ b/include/boost/fusion/algorithm/iteration/iter_fold.hpp @@ -22,7 +22,6 @@ #include #include #include -#include #include #define BOOST_FUSION_ITER_FOLD diff --git a/include/boost/fusion/algorithm/iteration/iter_fold_fwd.hpp b/include/boost/fusion/algorithm/iteration/iter_fold_fwd.hpp index 6c595cf1..1d8543ca 100644 --- a/include/boost/fusion/algorithm/iteration/iter_fold_fwd.hpp +++ b/include/boost/fusion/algorithm/iteration/iter_fold_fwd.hpp @@ -38,7 +38,7 @@ namespace boost { namespace fusion BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::iter_fold< Seq - , State const + , State , F >::type iter_fold(Seq& seq, State& state, F f); @@ -47,7 +47,7 @@ namespace boost { namespace fusion BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::iter_fold< Seq const - , State const + , State , F >::type iter_fold(Seq const& seq, State& state, F f); diff --git a/include/boost/fusion/algorithm/iteration/reverse_fold.hpp b/include/boost/fusion/algorithm/iteration/reverse_fold.hpp index f2d060f3..252ad308 100644 --- a/include/boost/fusion/algorithm/iteration/reverse_fold.hpp +++ b/include/boost/fusion/algorithm/iteration/reverse_fold.hpp @@ -22,7 +22,6 @@ #include #include #include -#include #include #define BOOST_FUSION_REVERSE_FOLD diff --git a/include/boost/fusion/algorithm/iteration/reverse_fold_fwd.hpp b/include/boost/fusion/algorithm/iteration/reverse_fold_fwd.hpp index 42c8ac21..c5e24b34 100644 --- a/include/boost/fusion/algorithm/iteration/reverse_fold_fwd.hpp +++ b/include/boost/fusion/algorithm/iteration/reverse_fold_fwd.hpp @@ -38,7 +38,7 @@ namespace boost { namespace fusion BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::reverse_fold< Seq - , State const + , State , F >::type reverse_fold(Seq& seq, State& state, F f); @@ -47,7 +47,7 @@ namespace boost { namespace fusion BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::reverse_fold< Seq const - , State const + , State , F >::type reverse_fold(Seq const& seq, State& state, F f); diff --git a/include/boost/fusion/algorithm/iteration/reverse_iter_fold.hpp b/include/boost/fusion/algorithm/iteration/reverse_iter_fold.hpp index 85abf12f..3276bbde 100644 --- a/include/boost/fusion/algorithm/iteration/reverse_iter_fold.hpp +++ b/include/boost/fusion/algorithm/iteration/reverse_iter_fold.hpp @@ -21,7 +21,6 @@ #include #include #include -#include #include #define BOOST_FUSION_REVERSE_FOLD diff --git a/include/boost/fusion/algorithm/iteration/reverse_iter_fold_fwd.hpp b/include/boost/fusion/algorithm/iteration/reverse_iter_fold_fwd.hpp index 21d99dee..76f01863 100644 --- a/include/boost/fusion/algorithm/iteration/reverse_iter_fold_fwd.hpp +++ b/include/boost/fusion/algorithm/iteration/reverse_iter_fold_fwd.hpp @@ -38,7 +38,7 @@ namespace boost { namespace fusion BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::reverse_iter_fold< Seq - , State const + , State , F >::type reverse_iter_fold(Seq& seq, State& state, F f); @@ -47,7 +47,7 @@ namespace boost { namespace fusion BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::reverse_iter_fold< Seq const - , State const + , State , F >::type reverse_iter_fold(Seq const& seq, State& state, F f); diff --git a/test/algorithm/fold.hpp b/test/algorithm/fold.hpp index 87a81a7c..997623ea 100644 --- a/test/algorithm/fold.hpp +++ b/test/algorithm/fold.hpp @@ -189,7 +189,7 @@ struct fold_test_n >::type , typename mpl::if_c< !n - , mpl::vector, mpl::int_<0> > const& + , mpl::vector, mpl::int_<0> >& , mpl::vector, mpl::int_ > >::type >