0

有没有办法在运行时声明 aboost::accumulator_set具有确定为运行时的功能?就像是:

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::... >>;
}
4

1 回答 1

1

没有。您需要编写一个类型擦除的累加器集包装器。这在运行时会表现得很糟糕,这就是为什么它不支持我们的开箱即用。

于 2016-04-07T15:43:24.617 回答