Subject: Re: [boost] [mpl][fold.html] apply<op, _1, deref<_2> > correction needed.
From: Larry Evans (cppljevans_at_[hidden])
Date: 2009-03-11 17:20:54
On 03/11/09 12:07, Larry Evans wrote:
> On 03/11/09 11:38, Steven Watanabe wrote:
>> Larry Evans wrote:
>>> The vault file:
>>> demonstrates the bug. What's the correct
>>> value for the ForwardOp arg to iter_fold in
>> Finally, when you use a lambda expression
>> inside another lambda expression, you need
>> to wrap it in protect.
>> mpl::apply<mpl::apply<op_meta_fun_elem<_1, _2>, _1, mpl::deref<_2> >,
>> state0, iter0>::type
>> is guaranteed to behave strangely, because all the placeholders
>> will be substituted by the outermost apply.
> So the documentation in fold.html should have used protect
> somewhere in apply<op,_1, deref<_2> >?
I think a combination of lambda<op>::type::apply<_1,deref<_2> > works,
at least according to the new version of the vault file just uploaded.
So, the fold.html docs are wrong and could be corrected by
apply<op,_1, deref<_2> >
, or am I missing something else.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk