Sdílet prostřednictvím


Chyba kompilátoru C3217

"parametr" : obecný parametr nelze v této deklaraci omezit.

Poznámky

Omezení bylo vytvořeno; parametr constraint generic musí souhlasit s parametrem šablony obecné třídy.

Example

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

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

generic <class T>
ref class C {
   generic <class T1>
   where T : A   // C3217
   void f();
};

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

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

generic <class T>
ref class C {
   generic <class T1>
   where T1 : A
   void f();
};