“模板类型”: 部分专用化中不允许有默认模板自变量
注解
部分专用化的模板不能包含默认自变量。
示例:
以下示例生成 C2756,并演示如何修复它:
// C2756.cpp
template <class T>
struct S {};
template <class T=int>
// try the following line instead
// template <class T>
struct S<T*> {}; // C2756
“模板类型”: 部分专用化中不允许有默认模板自变量
部分专用化的模板不能包含默认自变量。
以下示例生成 C2756,并演示如何修复它:
// C2756.cpp
template <class T>
struct S {};
template <class T=int>
// try the following line instead
// template <class T>
struct S<T*> {}; // C2756