有没有办法将整数模板参数限制为专门化而不是代码冗余?
// redundant code
template <int N>
struct A {};
template <>
struct A <0> {};
template <>
struct A <1> {};
// what i want is some thing like this
template <int N>
struct A {};
template <>
struct A <N < 2> {};
Run Code Online (Sandbox Code Playgroud)