std::experimental::bad_array_length

From cppreference.com
< cpp‎ | memory‎ | new
 
 
Utilities library
Type support (basic types, RTTI, type traits)
Dynamic memory management
Error handling
Program utilities
Variadic functions
Date and time
Function objects
(C++11)
Relational operators
Optional and any
(C++17)
(C++17)
Pairs and tuples
(C++11)
(C++17)
Swap, forward and move
(C++14)
(C++11)
(C++11)
Type operations
(C++11)
(C++17)
 
 
 
Defined in header <experimental/new>
class bad_array_length : public std::bad_alloc;

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)