“type”:模板参数不能为包含“auto”的类型
指示的模板参数类型不能包含 auto
关键字的用法。
更正此错误
- 不要使用
auto
关键字指定模板参数。
示例
以下示例生成 C3539。
// C3539.cpp
// Compile with /Zc:auto
template<class T> class C{};
int main()
{
C<auto> c; // C3539
return 0;
}
“type”:模板参数不能为包含“auto”的类型
指示的模板参数类型不能包含 auto
关键字的用法。
auto
关键字指定模板参数。以下示例生成 C3539。
// C3539.cpp
// Compile with /Zc:auto
template<class T> class C{};
int main()
{
C<auto> c; // C3539
return 0;
}