Path: utzoo!attcan!uunet!jarthur!usc!ucsd!ucbvax!pasteur!agate!darkstar!terra.ucsc.edu!daniel From: daniel@terra.ucsc.edu (Daniel Edelson) Newsgroups: comp.lang.c++ Subject: overloaded new Message-ID: <5252@darkstar.ucsc.edu> Date: 18 Jul 90 21:55:08 GMT Sender: usenet@darkstar.ucsc.edu Reply-To: daniel@terra.ucsc.edu () Organization: University of California, Santa Cruz Lines: 22 If a specialized operator new is defined and returns zero should the standard operator new() be called? This is behavior that we have observed in cfront 2.0. /* <> */ In particular if we define: void * operator new(size_t, int x) { return (void*) x; } Then we call int i = 0; p = new(i) S; where S is some type. The value assigned to p is nonzero. Replacing the standard `void * operator new(size_t)' with one that has an observable side effect demonstrates that it is being called. Should this happen? I can post code if needed. daniel