C, C++
[C++] (Exception) std::bad_alloc
Binceline
2013. 2. 7. 23:26
class bad_alloc;
Exception thrown on failure allocating memory
- exception
- bad_alloc
Type of the exceptions thrown by the standard definitions of operator new and operator new[] when they fail to allocate the requested storage space.
This class is derived from exception. See the exception class for the member definitions of standard exceptions.
Its member what returns a null-terminated character sequence identifying the exception.
Example
|
|
Possible output:
bad_alloc caught: bad allocation |
Exception safety
No-throw guarantee: no members throw exceptions.반응형