Boost logo

Boost Users :

Subject: Re: [Boost-users] accumulator operations
From: Eric Niebler (eric_at_[hidden])
Date: 2012-06-04 17:36:51

On 5/15/2012 11:04 PM, killogre wrote:
> Olaf Peter wrote
>> accumulator_set<..> acc1;
>> accumulator_set<..> acc2;
>> ...
>> accumulator_set<..> acc_all;
>> ...
>> acc1(42);
>> ...
>> acc_all += acc1;
>> ...
>> acc_all += acc2;
> I understand that it's not possible to += all types of accumulated
> statistics, but I will find it extremely useful to be able to do it for a
> lot of stats that support this (count, sum, moment, covariance, more...).
> Is there any way of using the accumulator_set interface to achieve the
> equivalent of acc1 += acc2 ?

This is an oft-requested feature. See:

I recall that this was discussed during the early design phases of the
library and was left out for just the reason you state -- it can't be
implemented consistently. Maybe some enterprising person will figure it
out and submit a patch. <nudge>

Eric Niebler
BoostPro Computing

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at