相关疑难解决方法(0)

动态调度模板功能?

是否可以在运行时决定调用哪个模板函数?就像是:

template<int I>
struct A {
    static void foo() {/*...*/}
};

void bar(int i) {
    A<i>::f();   // <-- ???
}
Run Code Online (Sandbox Code Playgroud)

c++ templates c++11

10
推荐指数
2
解决办法
3124
查看次数

标签 统计

c++ ×1

c++11 ×1

templates ×1