Nóta
Teastaíonn údarú chun rochtain a fháil ar an leathanach seo. Is féidir leat triail a bhaint as shíniú isteach nó eolairí a athrú.
Teastaíonn údarú chun rochtain a fháil ar an leathanach seo. Is féidir leat triail a bhaint as eolairí a athrú.
'param' : generic parameter cannot be constrained in this declaration
Remarks
A constraint was ill formed; the constraint generic parameter must agree with the generic class template parameter.
Example
The following example generates C3217:
// C3217.cpp
// compile with: /clr
interface struct A {};
generic <class T>
ref class C {
generic <class T1>
where T : A // C3217
void f();
};
The following example demonstrates a possible resolution:
// C3217b.cpp
// compile with: /clr /c
interface struct A {};
generic <class T>
ref class C {
generic <class T1>
where T1 : A
void f();
};