Bemærk
Adgang til denne side kræver godkendelse. Du kan prøve at logge på eller ændre mapper.
Adgang til denne side kræver godkendelse. Du kan prøve at ændre mapper.
'member_function' : cannot specify constraints, they are inherited from the base method
Remarks
When overriding a generic member function, you cannot specify constraint clauses (repeating the constraints implies that the constraints are not inherited).
The constraint clauses on the generic function you are overriding will be inherited.
For more information, see Constraints on Generic Type Parameters (C++/CLI).
Example
The following example generates C3299.
// C3299.cpp
// compile with: /clr /c
public ref struct R {
generic<class T>
where T : R
virtual void f();
};
public ref struct S : R {
generic<class T>
where T : R // C3299
virtual void f() override;
};