Compiler Error C3219
Visual Studio 2015
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 C3219.
param' : generic parameter cannot be constrained by multiple non-interfaces : 'class'
It is not valid to constrain a generic parameter by two or more managed classes.
The following sample generates C3219:
// C3219.cpp
// compile with: /clr
ref class A {};
ref class B {};
generic <class T>
where T : A, B
ref class E {}; // C3219
The following sample demonstrates a possible resolution:
// C3219b.cpp
// compile with: /clr /c
ref class A {};
interface struct C {};
generic <class T>
where T : A
ref class E {};
Show: