Compiler Error C2906

 

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 C2906.

specialization' : explicit specialization requires 'template <>'

You must use the new syntax for explicit specialization of templates.

The following sample generates C2906:

// C2906.cpp  
// compile with: /c  
template<class T> class X{};   // primary template  
class X<int> { }   // C2906  
template<> class X<int> { };   // new syntax  

Show: