std::bad_array_new_length (3) - Linux Manuals
std::bad_array_new_length: std::bad_array_new_length
NAME
std::bad_array_new_length - std::bad_array_new_length
Synopsis
Defined in header <new>
class bad_array_new_length; (since C++11)
std::bad_array_new_length is the type of the object thrown as exceptions by the new-expressions to report invalid array lengths if
1) array length is negative
2) total size of the new array would exceed implementation-defined maximum value
3) the number of initializer-clauses exceeds the number of elements to initialize
Only the first array dimension may generate this exception; dimensions other than the first are constant expressions and are checked at compile time.
std-bad array new length-inheritance.svg
Inheritance diagram
Member functions
constructor (public member function)
Inherited from std::bad_alloc
Inherited from std::exception
Member functions
destructor destroys the exception object
[virtual]
what returns an explanatory string
[virtual]
Notes
The override for the virtual member function what() may by provided, but is not required.
Example
Three conditions where std::bad_array_new_length should be thrown:
// Run this code
See also
operator_new (function)
operator_new[]
bad_alloc (class)