I see the following constructs:
new X
will free the memory if X
constructor throws.
operator new()
can be
'placement new' is not an overloaded version of new, but one of the variants of operator new , and also one that cannot be overloaded.
See can see the list of new operators here along with a description on how overloading them works.
If a constructor throws an exception when using placement new the compiler knows what new operator was used and call placement delete.