|
From: staale <st...@le...> - 2002-05-07 21:42:41
|
Search for 'how to handel Circular references' or somthing like that. I =
also belive this situation usualy is discussed in a decent 'Design =
patterns' book.
MVH
Staale
----- Original Message -----=20
From: Shaddow=20
To: dev...@li...=20
Sent: Tuesday, May 07, 2002 10:24 PM
Subject: Re: [Dev-C++] Foward declaration
I didn't see the original question so I may be answering something =
that hasn't actually been asked. If so, just ignore what I have to say.
While it's true that you'd get yourself into all kinds of trouble =
trying to have A be a data member of B and B a data member of A, it is =
entirely possible (and actually at times necessary) to have B* be a data =
member of A and A* be a data member of B. You see this kind of a =
situation frequently in frameworks.
class B;
class A
{
B* b;
};
class B
{
A* a;
};
Ioannis Vranos wrote:
I suppose the question was for me and i suppose the question is to have2 =
classes one containing an object of the other (i did not pay =
muchattention when i saw the code).Well this cannot be done and it is =
good it can't be done, because thenthe computers would crash. :)Imagine =
the code:class B;class A{ B b;};class B{ A a;};A contains a B which =
contains an A which contains a B...That's why it can't be done.Ioannis* =
Ioannis Vranos* Programming pages: http://www.noicys.cjb.net* =
Alternative URL: http://run.to/noicys
-----Original Message-----From: =
dev...@li... =
[mailto:dev...@li...] On Behalf Of Ricardo =
L=F3pez RuizSent: Tuesday, May 07, 2002 9:45 PMTo: Dev-C++Subject: Re: =
[Dev-C++] Foward declarationThen, is there no possibility to program =
somethingas Luis Bras propose??...Some special trick, I =
mean.Ricardo.____________________________________________________________=
___Have big pipes? SourceForge.net is looking for download mirrors. We =
supplythe hardware. You get the recognition. Email Us: =
bandwidth@sourceforge.net_______________________________________________D=
ev-
cpp-users mailing =
lis...@li...://lists.sourceforge.net/list=
s/listinfo/dev-cpp-users
_______________________________________________________________Have big =
pipes? SourceForge.net is looking for download mirrors. We supplythe =
hardware. You get the recognition. Email Us: =
bandwidth@sourceforge.net_______________________________________________D=
ev-cpp-users mailing =
lis...@li...://lists.sourceforge.net/list=
s/listinfo/dev-cpp-users
|