编译器错误 C2917

name”:无效的模板参数

注解

模板参数列表包含不是一个模板参数的标识符。

此错误在 Visual Studio 2022 及更高版本中已过时。

示例

以下示例生成 C2917。

// C2917.cpp
// compile with: /c
template<class T> class Vector {
   void sort();
};

template<class T*> void Vector<T>::sort() {}   // C2917
// try the following line instead
// template<class T> void Vector<T>::sort() {}