编译器错误 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() {}
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈