הערה
הגישה לדף זה מחייבת הרשאה. באפשרותך לנסות להיכנס או לשנות מדריכי כתובות.
הגישה לדף זה מחייבת הרשאה. באפשרותך לנסות לשנות מדריכי כתובות.
'base_function': overriding virtual function return type differs from 'override_function'
Remarks
A function in a derived class attempted to override a virtual function in a base class, but the derived class function did not have the same return type as the base class function. An override function signature must match the signature of the function being overridden.
Example
The following example generates C2553:
// C2553.cpp
// compile with: /clr /c
ref struct C {
virtual void f();
};
ref struct D : C {
virtual int f() override ; // C2553
// try the following line instead
// virtual void f() override;
};