type of fn


The type of an overriding function must be the same as the type of the virtual function it overrides ,except that the return type may be relaxed. That is, if the original return type was B *, then the return type of the overriding function may be D *, provided B is a public base of D . Similarly, a return type of B & may be relaxed to D &.


What does this text mean when it says "The type of an overriding function must be the same as the type of the virtual function it overrides"

This pertains to virtual function overriding from a derived class.
The "type" refers to the return type and parameter types and number, I believe.
The return type, the number of parameters, the types of those parameters, and the storage class modifiers of the function (const, volatile)
Topic archived. No new replies allowed.