C++ Language/Objects/Constructors/MemoryFull
The C language's malloc()
returned NULL
if memory was full when that allocation was attempted.
C++'s CRType* poObj = new CRType;
instead throws a std::bad_alloc
exception.
Alternatively, you could use std::set_new_handler()
to specify a callback that will be repeatedly called until enough memory is available.
Additional information about memory being full
Category:Book:C++ Language#Objects/Constructors/MemoryFull%20