Simplifying nothrow new usage
As mentioned in Chapter 7, the default behavior of operator new() when unable to perform an allocation request is to throw an exception. This can result from such situations as running out of memory or otherwise being unable to service the allocation request, in which case, one usually throws std::bad_alloc; from an incorrect array length (for example, a negative length of one exceeding implementation-defined limits), usually leading to std::bad_array_new_length being thrown; or from failure to complete the subsequent construction of the object following the completion of operator new(), in which case, the exception that will be thrown will be whatever was thrown from the failing constructor.
Exceptions are the “normal” way for a C++ function to signal failure to meet the function’s postconditions. In some cases, such as a constructor or an overloaded operator, it’s the only real, workable way to do so: a constructor has...