We need to be able to disable global operator new at compile time. We
are developing a large library and need to control all memory
allocation and cannot have a mistake whereby a mistaken use of global
operator new creeps in. It is not feasible to solve this via
implementing our own global operator new which asserts(false), as
there is no practical way to test all paths of execution. This is a
large and complex library, to say the least. In fact there's a chance
you are using it to read this message. :)
Due to the design of C++ and its special/unusual treatment of new/
delete, I can think of no way to accomplish this, nor can I think of
an alternative means to accomplish what we need. #defining new away
doesn't work because placement new and class new still need to work.