[comp.lang.c++] overloaded new

daniel@terra.ucsc.edu (Daniel Edelson) (07/19/90)

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.
	/* <<AT&T C++ Translator 2.00 06/30/89>> */
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