Win32 Port of Safari

Bernd Brandstetter bbrand at freenet.de
Sun Jan 12 11:04:54 GMT 2003


On Sunday 12 January 2003 04:09, Alan Gutierrez wrote:
> Dirk Mueller wrote:
>  > On Fre, 10 Jan 2003, Alan Gutierrez wrote:
>  >>-AttrImpl *NamedAttrMapImpl::getNamedItem ( NodeImpl::Id id ) const
>  >>+// AttrImpl *NamedAttrMapImpl::getNamedItem ( NodeImpl::Id id )
>  >> const AJG +NodeImpl *NamedAttrMapImpl::getNamedItem ( NodeImpl::Id
>  >> id ) const
>  >
>  > is this a compiler warning or a compile fix ? C++ definitely allows
>  > signatures to differ based on the return type.
>
> Mr Mueller
>
> I need some scouring the rust of my C++ knowledge.
>
> Here is the result of gg: return type signature group:comp.std.c++
>
> http://groups.google.com/groups?q=return+type+signature+group:comp.std.c
>%2B%2B
>
> These are the most recent threads I could find.
>
> http://groups.google.com/groups?th=f7452872378d982c
> http://groups.google.com/groups?th=7c5c2ef7b7bcf935
>
> They state that overloading by return type is not supported by the
> standard. The discussions also imply that although not allowed, it is
> certianly possible for many compilers, since many compilers put the
> return type in the mangled name.

I don't have the standard at hand right now, but "Thinking in C++" says (p. 
693):
"[...] you cannot modify the return type of a virtual function during 
overriding. This is generally true, but three is a special case in which 
you can slightly modify the return type. If you're returning a pointer or 
a reference to a base class, then the overridden version may return a 
pointer or reference to a class derived from what the base returns."

Best regards,
Bernd





More information about the kfm-devel mailing list