0xFF
0xFF

Reputation: 4178

Initialize a boost::accumulator_set at runtime

Is there a way to declare at runtime a boost::accumulator_set with features determined as runtime? Something like:

accumulator_set *acc;

if (SomeUserInput1)
{
  acc = new accumulator_set< double, features< tag::min >>;
}

if (SomeUserInput2)
{
  acc = new accumulator_set< double, features< tag::min, tag::max, tag::mean, tag::... >>;
}

Upvotes: 0

Views: 237

Answers (1)

Eric Niebler
Eric Niebler

Reputation: 6177

There isn't. You would need to write a type-erased accumulator set wrapper. That would perform badly at runtime, which is why it isn't supported our off the box.

Upvotes: 1

Related Questions