'template type':在部分特製化上不允許預設的範本引數
備註
部分特製化的範本不能包含預設引數。
範例
下列範例會產生 C2756,並示範如何修正此問題:
// C2756.cpp
template <class T>
struct S {};
template <class T=int>
// try the following line instead
// template <class T>
struct S<T*> {}; // C2756
'template type':在部分特製化上不允許預設的範本引數
部分特製化的範本不能包含預設引數。
下列範例會產生 C2756,並示範如何修正此問題:
// C2756.cpp
template <class T>
struct S {};
template <class T=int>
// try the following line instead
// template <class T>
struct S<T*> {}; // C2756