Compiler Error C3236

 

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

explicit instantiation of a generic is not allowed

The compiler does not allow explicit instantiation of generic classes.

The following sample generates C3236:

// C3236.cpp  
// compile with: /clr  
generic<class T>  
public ref class X {};  
  
generic ref class X<int>;   // C3236  

The following sample demonstrates a possible resolution:

// C3236b.cpp  
// compile with: /clr /c  
generic<class T>  
public ref class X {};  

Show: