std::bad_array_length

From cppreference.com
< cpp‎ | memory‎ | new
 
 
 
 
 
Defined in header <new>
class bad_array_length : public std::bad_alloc;
(since C++14)

std::bad_array_length is the type of the object thrown as exceptions by the constructors of arrays of runtime bound and objects of type std::dynarray to report invalid array lengths if

1) array length is negative or equal to zero (for arrays of runtime bound)
2) total size of the new array would exceed implementation-defined maximum value (for both arrays of runtime bound and std::dynarray)

Contents

[edit] Member functions

(constructor)
constructs the bad_array_length object
(public member function)

std::bad_array_length::bad_array_length

bad_array_length();
(since C++14)

Constructs new exception object.

Parameters

(none)

Exceptions

noexcept specification:  
noexcept
  

Inherited from std::bad_alloc

Inherited from std::exception

Member functions

[virtual]
destructs the exception object
(virtual public member function of std::exception)
[virtual]
returns an explanatory string
(virtual public member function of std::exception)

[edit] Notes

The override for the virtual member function what() may by provided, but is not required.

[edit] Example

[edit] See also

exception thrown on allocation of array with invalid length
(class)