public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* mutual recursive class
@ 2002-05-19  3:26 polux moon
  2002-05-19  4:37 ` bjorn rohde jensen
  0 siblings, 1 reply; 2+ messages in thread
From: polux moon @ 2002-05-19  3:26 UTC (permalink / raw)
  To: gcc-help

How do you declare mutual recursiv class ?
example:

class A{
B* b;
};

class B{
A* a;
};

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: mutual recursive class
  2002-05-19  3:26 mutual recursive class polux moon
@ 2002-05-19  4:37 ` bjorn rohde jensen
  0 siblings, 0 replies; 2+ messages in thread
From: bjorn rohde jensen @ 2002-05-19  4:37 UTC (permalink / raw)
  To: polux moon; +Cc: gcc-help

Hi

 Since you are only using class B in name in class A,
forward declaring class B should be enough.

Yours sincerely,

Bjorn

polux moon wrote:
> 
> How do you declare mutual recursiv class ?
> example:
> 

class B;

> class A{
> B* b;
> };
> 
> class B{
> A* a;
> };

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-05-19 11:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-05-19  3:26 mutual recursive class polux moon
2002-05-19  4:37 ` bjorn rohde jensen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).