Member Functions and the Global operator new() and operator new[]()

When an object of a class type is created with the new operator, the member operator new() function is implicitly called. The first argument is the amount of space requested.

The following rules determine which storage allocation function is used:

  1. If your own operator new() exists, and the :: operator is not used, your operator new() is used.
  2. If you have not defined an operator new() function, the global ::operator new() function defined in <new.h> is used. The allocation expression of the form ::operator new() ensures that the global new operator is called, rather than your class member operator.

When a nonclass object is created with the new operator, the global ::operator new() is used.

The order of evaluation of a call to an operator new() is undefined in the evaluation of arguments to constructors. If operator new() returns 0, the arguments to a constructor may or may not have been evaluated.