有没有一种方法可以在运行时声明一个功能被确定为运行时的boost::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::... >>;
}发布于 2016-04-07 23:43:25
没有,你需要写一个类型擦除的累加器集合包装。这会在运行时表现得很差,这就是为什么我们不支持它的原因。
https://stackoverflow.com/questions/36462724
复制相似问题