Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!gem.mps.ohio-state.edu!apple!rutgers!att!dptg!ulysses!andante!alice!ark From: ark@alice.UUCP (Andrew Koenig) Newsgroups: comp.lang.c++ Subject: Re: calling constructor (again) Message-ID: <10025@alice.UUCP> Date: 16 Oct 89 17:03:44 GMT References: <1989Oct13.175853.24335@polyslo.CalPoly.EDU> Distribution: usa Organization: AT&T Bell Laboratories, Liberty Corner NJ Lines: 16 WARNING -- THE FOLLOWING TECHNIQUE IS RECOMMENDED ONLY FOR PEOPLE WHO ARE SURE THEY KNOW WHAT THEY'RE DOING. To construct an object of class T at location x, do the following: void* operator new(size_t, void* p) { return p; } // ... new(x) T; // construct the object This effectively calls T::T() and tells it to do its thing at location x. -- --Andrew Koenig ark@europa.att.com