dhruva wrote:
Hello, I am writing a wrapper class which gets data over time and has to compute a variety of statistics using boost::accumulators. The accumulator cannot be a variable on the stack (function local variable) as it will go out of scope after the function invocation. I will have to make it a member variable of a class. I will not know the type of calculations to requested at compile time. I therefore need a generic accumulator type as member and add the specific type at runtime. <snip>
It doesn't sound like Boost.Accumulators is a good fit for your problem. Accumulators uses static type information to resolve computational dependencies and order calculations. As you don't know what you will be computing until runtime, you can't provide Accumulators with the static type information it requires. -- Eric Niebler BoostPro Computing http://www.boostpro.com