Topic: Change of return type on overloaded virtual functions


Author: "Giovanni Bajo" <giovannibajo@REMOVEliberoTHIS.it>
Date: Mon, 20 May 2002 19:34:43 GMT
Raw View
"Carter Smithhart" <carter.l.smithhart@boeing.com> ha scritto nel messagg=
io
news:GwFByt.DG9@news.boeing.com...
> Given two classes A and B, is this legal?
[snip]

Yes, and it doesn't even require that the virtual functions return the ty=
pe
of the enclosing class. Any couple of classes with a base/inherited relat=
ion
would do the trick.

> If the link to where this is discussed in the standard could be provide=
d,
> that would be much appreciated.

=A710.3p5. This feature is called 'covariant return types' among friends.

Giovanni Bajo

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]