编译器错误 C2770
“template”的显式模板或泛型参数无效
具有显式模板或泛型参数的函数模板候选项导致不允许的函数类型。
以下示例生成 C2770:
// C2770.cpp
#include <stdio.h>
template <class T>
int f(typename T::B*); // expects type with member B
struct Err {};
int main() {
f<int>(0); // C2770 int has no B
// try the following line instead
f<OK>(0);
}
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈