Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!uakari.primate.wisc.edu!polyslo!ttwang From: ttwang@polyslo.CalPoly.EDU (Thomas Wang) Newsgroups: comp.lang.c++ Subject: calling constructor (again) Message-ID: <1989Oct13.175853.24335@polyslo.CalPoly.EDU> Date: 13 Oct 89 17:58:53 GMT Reply-To: ttwang@polyslo.CalPoly.EDU (Thomas Wang) Distribution: usa Organization: Cal Poly State University -- San Luis Obispo Lines: 22 I still have not solved the problem of directly calling the constructor. This requirement came from my garbage collection project. For each garbage collectable class 'foo', there is a reference class 'ref_foo'. When a 'foo' object is created, it must be registered with its reference handle. If I do the registration after the construction of 'foo', I will have a problem. It is possible to trigger garbage inside the 'foo' constructor, when the new object is not yet registered. There are some complications, but the end result is that live objects will be deleted. The proper sequence must be: create space, register with reference, call object constructor. If I cannot call constructors directly with AT&T compiler, I will be forced to only implement for g++. -Thomas Wang (Ranma no baka! - Ranma 1/2 ) ttwang@polyslo.calpoly.edu