【发布时间】:2014-06-30 13:17:07
【问题描述】:
我想这对于知道模板的人来说是微不足道的......
假设我们想要这个模板类的两个不同实现,取决于 N 的值:
template <int N>
class Foo {
...
};
例如:
template <int N>
class Foo {
... // implementation for N <= 10
};
template <int N>
class Foo {
... // implementation for N > 10
};
我们如何在 C++11 中做到这一点?
【问题讨论】:
标签: c++ templates c++11 template-meta-programming