2016-04-06 77 views
0

有没有办法在运行时声明确定为运行时的功能boost::accumulator_set? 类似于:在运行时初始化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::... >>; 
} 

回答

1

没有。你需要编写一个类型擦除的累加器集合包装器。这在运行时会表现不佳,这就是为什么它不支持我们。