Compiler Error C3539
Visual Studio 2015
The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.
The latest version of this topic can be found at Compiler Error C3539.
type': a template-argument cannot be a type that contains 'auto'
The indicated template argument type cannot contain a usage of the auto keyword.
To correct this error
- Do not specify the template argument with the
autokeyword.
The following example yields C3539.
// C3539.cpp
// Compile with /Zc:auto
template<class T> class C{};
int main()
{
C<auto> c; // C3539
return 0;
}
Show: