Compiler Warning (level 3) C4231
TOC
Collapse the table of content
Expand the table of content
The document is archived and information here might be outdated

Compiler Warning (level 3) C4231

nonstandard extension used : 'identifier' before template explicit instantiation

When Microsoft extensions are enabled (/Ze), an extern template can be instantiated, generating this warning. Under ANSI compatibility (/Za), such instantiations cause an error.

Example

// C4231.cpp
// compile with: /W3
template<class T, int i> class MyStack {}; // C4231
extern template MyStack< int, 4>;

int main()
{
}
Show:
© 2016 Microsoft