This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Covariant return types and order of class definitions
- From: Ben Davis <bnd25 at cam dot ac dot uk>
- To: gcc-help at gcc dot gnu dot org
- Date: Thu, 18 Dec 2003 23:08:49 +0000
- Subject: Re: Covariant return types and order of class definitions
- Organization: Cambridge University
- References: <200312182158.26877.bnd25@cam.ac.uk>
Hi,
I have found an answer to my question. The C++ ISO standard says:
"If the return type of D::f differs from the return type of B::f, the class
type in the return type of D::f shall be complete at the point of declaration
of D::f or shall be the class type D."
So I have to put the whole of VolumePlayerEnvelope's definition first. I guess
this renders a forward declaration with inheritance information somewhat
useless. :)
Thanks anyway,
Ben