Neelesh said:
That won't work. The definitions of E and F are essential for this code
to compile - a forward declaration of a class is sufficient only if we
are not inplicitly or explicitly requesting for size of the class or
are referring to any members.
Comeau online compiles it. It complains about using an incomplete type
if I add a member of type E to the class though:
E e;
added after the declaration of the foo function.
I don't have the standard to hand to check (I am relying on the fact
that Comeau doesn't get much wrong) but it would seem to me that the
definitions of E and F are not needed (e.g. to know the sizes of
objects of those types) until the _definition_ of the foo member
function.
Gavin Deane