Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

Compiler Warning (level 1) C4812

Error Message

obsolete declaration style: please use 'new_syntax' instead

In the current release of Visual C++, the explicit constructor specialization is still supported, but it may not be supported in a future release.

The following sample generates C4812:

// C4812.cpp
// compile with: /W1 /c
template <class T> 
class MyClass;

template<class T>
class MyClass<T*> {
   MyClass();
};

template<class T>
MyClass<T*>::MyClass<T*>() {}   // C4812
// try the following line instead
// MyClass<T*>::MyClass() {}

Community Additions

ADD
Show:
© 2015 Microsoft