W3cubDocs

/C++

std::experimental::bad_array_length

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)

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)

Notes

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

Example

See also

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

© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
http://en.cppreference.com/w/cpp/memory/new/bad_array_length