mirror of
https://github.com/boostorg/fusion.git
synced 2025-07-19 23:32:17 +02:00
segmented_fold_until should unpack the state's value before invoking the user's function
[SVN r73668]
This commit is contained in:
@ -23,7 +23,7 @@ namespace boost { namespace fusion { namespace detail
|
|||||||
{
|
{
|
||||||
typedef
|
typedef
|
||||||
fusion::result<
|
fusion::result<
|
||||||
typename result_of::fold<Range, typename State::value_type, Fun>::type,
|
typename result_of::fold<Range, State, Fun>::type,
|
||||||
continue_
|
continue_
|
||||||
>
|
>
|
||||||
type;
|
type;
|
||||||
@ -37,7 +37,7 @@ namespace boost { namespace fusion { namespace detail
|
|||||||
typename result<segmented_fold_fun(Range&, State const&, Context const&)>::type
|
typename result<segmented_fold_fun(Range&, State const&, Context const&)>::type
|
||||||
operator()(Range& rng, State const& state, Context const&) const
|
operator()(Range& rng, State const& state, Context const&) const
|
||||||
{
|
{
|
||||||
return fusion::fold(rng, state.value, fun);
|
return fusion::fold(rng, state, fun);
|
||||||
}
|
}
|
||||||
|
|
||||||
Fun const& fun;
|
Fun const& fun;
|
||||||
|
@ -216,12 +216,16 @@ namespace boost { namespace fusion
|
|||||||
struct segmented_fold_until_impl<Range, State, Context, Fun, false>
|
struct segmented_fold_until_impl<Range, State, Context, Fun, false>
|
||||||
{
|
{
|
||||||
typedef
|
typedef
|
||||||
typename boost::result_of<Fun(Range&, State const&, Context const&)>::type
|
typename boost::result_of<Fun(
|
||||||
|
Range&,
|
||||||
|
typename add_reference<typename add_const<typename State::value_type>::type>::type,
|
||||||
|
Context const&
|
||||||
|
)>::type
|
||||||
type;
|
type;
|
||||||
|
|
||||||
static type call(Range& rng, State const& state, Context const& context, Fun const& fun)
|
static type call(Range& rng, State const& state, Context const& context, Fun const& fun)
|
||||||
{
|
{
|
||||||
return fun(rng, state, context);
|
return fun(rng, state.value, context);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -539,7 +539,6 @@ namespace boost { namespace fusion { namespace extension
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
// TODO: remove invocation of distance in iterator_range.
|
|
||||||
// TODO: default implementation of begin, end, and size
|
// TODO: default implementation of begin, end, and size
|
||||||
// should check if the sequence is segmented and to
|
// should check if the sequence is segmented and to
|
||||||
// the right thing.
|
// the right thing.
|
||||||
|
Reference in New Issue
Block a user