Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!brutus.cs.uiuc.edu!apple!usc!polyslo!ttwang From: ttwang@polyslo.CalPoly.EDU (Thomas Wang) Newsgroups: comp.object Subject: Re: Pre-computing objects Message-ID: <1989Oct30.214745.19419@polyslo.CalPoly.EDU> Date: 30 Oct 89 21:47:45 GMT References: <4671be53.20b6d@apollo.HP.COM> <2561@fai.UUCP> Reply-To: ttwang@polyslo.CalPoly.EDU (Thomas Wang) Distribution: usa Organization: Cal Poly State University -- San Luis Obispo Lines: 29 kurtl@fai.fai.com (Kurt Luoto) writes: >In article <4671be53.20b6d@apollo.HP.COM> vinoski@apollo.HP.COM (Stephen Vinoski) writes: >There are other related situations that I have run into where the >C++ language could not provide any magic: > II. I have a particular inheritance tree of classes. A client module > needs to allocate storage in a particular place for an instance > of one of these classes. The client needs to allocate a buffer > large enough to hold an instance of any class in the tree. But > we would like to not have to burden the client code with explicit > knowledge about all classes. Does not this waste some storage space, with additional to the complexity of the design? Why can't the client contains a 'reference' to the super-class of all objects which it could contain? This is the scheme usually used for system with automatic memory management. >Kurt W. Luoto kurtl@fai.fai.com or ...!sun!fai!kurtl -Thomas Wang ("This is a fantastic comedy that Ataru and his wife Lum, an invader from space, cause excitement involving their neighbors." - from a badly translated Urusei Yatsura poster) ttwang@polyslo.calpoly.edu