Subject: Re: [boost] [accumulators] why not operator+=?
From: Alan Patterson (alan.patterson_at_[hidden])
Date: 2009-02-02 13:05:23
Steven Watanabe wrote:
> Alan Patterson wrote:
>> Doesn't a += interface make an accumulate interface like:
>> std::accumulate(data.begin(), data.end(), acc);
>> more appealing than :
>> std::for_each(data.begin(), data.end(), acc);
> std::accumulate uses
> result = result + *iter;
> result += *iter;
> In Christ,
> Steven Watanabe
> Unsubscribe & other changes:
Yes. But I guess the original question was that why not a += (or +)
operator implemented in accumulator_set to add samples instead of
Using std::accumulate to accumulate samples (in an accumulation
library) seems more natural to me than the functional implementation.
And, using accumulate implies addition operators.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk