Edit

Share via


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 {};