Boost logo

Boost :

Subject: Re: [boost] [accumulators] why not operator+=?
From: Alan Patterson (alan.patterson_at_[hidden])
Date: 2009-02-02 06:49:07


John Phillips wrote:
> Eric Niebler wrote:
>> Neal Becker wrote:
>>> A nit perhaps, but why not overload += to process samples?
>>>
>>
>> Would that be horribly misleading if the accumulator set isn't
>> actually doing addition? I'm happy with the function-style interface.
>>
>
> Just personal preference, but I also prefer the function style
> interface. A += interface would imply addition to me, whether it is
> what is really happening or not.
>
> John
>
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost
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);

Alan


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