Covariant return types and order of class definitions

Ben Davis
Thu Dec 18 23:02:00 GMT 2003


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,


More information about the Gcc-help mailing list