Boost logo

Boost Users :

From: Eric Niebler (eric_at_[hidden])
Date: 2008-09-01 17:23:53


Kim Kuen Tang wrote:
> Hi all,
>
> i ' ve written a piece of code to get the class sum_accumulator working
> which is described in the user's guide
> http://boost-sandbox.sourceforge.net/libs/accumulators/doc/html/accumulators/user_s_guide.html#accumulators.user_s_guide.the_accumulators_framework.extending_the_accumulators_framework.
>
>
> The function result must be provided with a struct dont_care.
> And the constructor of dont_care must be provided with a value to get an
> instanciation.
> In my opinion a default constructor taking no arguments for the struct
> dont_care must exists so the user can write code like dont_care().
>
> To get the example working i must write code like
> sumacc.result(*dont_care(0.0)*) to get the result from my accumulator.
> And this is a little bit unnecessary.
<snip>

The interface you're describing is an internal interface, consumed by
the accumulator_set<>. End-user code should never be directly calling
the result() member function of an accumulator implementation.
Accumulators are not supposed to be used stand-alone ... only as part of
an accumulator_set<>.

HTH,

-- 
Eric Niebler
BoostPro Computing
http://www.boostpro.com

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net