Win32 Port of Safari
Maks Orlovich
mo002j at mail.rochester.edu
Sun Jan 12 06:57:16 GMT 2003
>
> They state that overloading by return type is not supported by the
> standard.
This is not an example of overloading*. The code is not asking the compiler
to pick the right one of two versions of a method based on the return
value. This is an instance of what's call covariant return -- a child class
is narrowing the return type of a re-implement function to be a specific
sub-type of what the parent's version returns.
See 10.3.5 in http://www.csci.csusb.edu/dick/c++std/cd2/derived.html for the
specific stuff in the draft version of the C++ standard.
* Although I am pretty sure some people call re-implementation that way - I
know I used to, and must have picked up the habit from someplace, and it
took at lot of unlearning to stop doing that - was worth it, though, since,
if you pardon the usage, overload of terminology tends to confuse things.
-Maksim
More information about the kfm-devel
mailing list