Covariant return types and order of class definitions

Ben Davis bnd25@cam.ac.uk
Thu Dec 18 23:02:00 GMT 2003


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



More information about the Gcc-help mailing list