An operator new
function (be it the global one or a class-specific one) is not the entire implementation of a new
expression. It's only the allocation function. When you write new T
in your code, the following happens:
An appropriate allocation function named
operator new
is chosen and called to obtain space for the object.T
's constructor is called on the space obtained from point 1.
This means there is no way to bypass constructor invocation by writing your own operator new
- invoking the constructor is done by the language, not by the allocation function.