Partilhar via


Erro do compilador C3216

restrição deve ser um parâmetro genérico, não 'tipo'

Observações

Uma restrição estava mal definida.

Example

O exemplo a seguir gera 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 {};

O exemplo a seguir demonstra uma possível resolução:

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

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