Sdílet prostřednictvím


Chyba kompilátoru C3216

constraint musí být obecný parametr, nikoli type.

Poznámky

Omezení bylo špatně vytvořeno.

Example

Následující příklad vygeneruje C3216:

// C3216.cpp
// compile with: /clr
interface struct A {};

generic <class T>
where F : A   // C3216
// Try the following line instead:
// where T : A    // C3216
ref class C {};

Následující příklad ukazuje možné řešení:

// C3216b.cpp
// compile with: /clr /c
interface struct A {};

generic <class T>
where T : A
ref class C {};