Boost logo

Boost :

Subject: Re: [boost] [fusion] discrepancy between std::accumulate and fusion::accumulate
From: David Abrahams (dave_at_[hidden])
Date: 2008-09-19 12:05:46


on Fri Sep 19 2008, "Stjepan Rajko" <stipe-AT-asu.edu> wrote:

> Hello,
>
> I just started playing with an abstracted accumulate function which
> can be called either with a fusion sequence or a range, and calls
> fusion::accumulate or std::accumulate as appropriate. In using it, I
> ran into an interesting discrepancy: std::accumulate expects binary
> functions which take the accumulator as the first argument and the
> sequence element as the second argument. fusion::accumulate expects
> the arguments in reverse. This discrepancy makes the abstraction
> unnecessarily complicated, because the binary function has to either
> be able to receive the arguments in either order, or be adapted (e.g.,
> with bind) for one of the cases. Or, I'm just missing something :-)

I consider this a Fusion bug.

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk