编译器错误 C2753
“template”:部分专用化无法匹配主模板的参数列表
如果模板实参列表与形参列表匹配,编译器会将其视为相同的模板。 不允许两次定义相同的模板。
示例
以下示例生成 C2753 并显示了其修复方法:
// C2753.cpp
// compile with: cl /c C2753.cpp
template<class T>
struct A {};
template<class T>
struct A<T> {}; // C2753
// try the following line instead
// struct A<int> {};
template<class T, class U, class V, class W, class X>
struct B {};
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈