Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!rutgers!bellcore!faline!thumper!ulysses!andante!alice!shopiro From: shopiro@alice.UUCP (Jonathan Shopiro) Newsgroups: comp.lang.c++ Subject: Re: Calling constructors on already allocated data Summary: Altenatively, include Message-ID: <9304@alice.UUCP> Date: 4 May 89 16:47:50 GMT References: <13096@pasteur.Berkeley.EDU> <9298@alice.UUCP> Organization: AT&T Bell Laboratories, Murray Hill NJ Lines: 15 In article <9298@alice.UUCP>, shopiro@alice.UUCP (Jonathan Shopiro) writes: > First, put the following line in your header file. > > inline void* operator new(long, void* p) { return p; } > It was pointed out to me that there is a supplied header file, new.h, that makes this unnecessary. If you use new.h, you will get the same function, but it won't be called inline. This has the disadvantage that there is some performance penalty, but has the advantage that you can replace the implementation (say to keep a log of allocations) without re-compiling everything, and you can put a breakpoint on it. -- Jonathan Shopiro AT&T Bell Laboratories, Warren, NJ 07060-0908 research!shopiro (201) 580-4229