std::bad_alloc(3)

std::bad_alloc3

Exception possibly thrown by new.

Usage

#include <new_except.h>

Inherits std::exception.

Public Member Functions

_GLIBCXX26_CONSTEXPR bad_alloc (const bad_alloc &)=default
_GLIBCXX26_CONSTEXPR bad_alloc & operator= (const bad_alloc &)=default
virtual constexpr const char * what () const noexcept

Detailed Description

Exception possibly thrown by new.

bad_alloc (or classes derived from it) is used to report allocation errors from the throwing forms of new.

Member Function Documentation

virtual constexpr const char * std::bad_alloc::what () const [inline], [constexpr], [virtual], [noexcept]

Returns a C-style character string describing the general cause of the current error.

Reimplemented from std::exception.

Releases

4 releases since Debian 3.1 (Sarge); the text changed 3 times.

  1. 3.1
  2. 4.0
  3. 5.0
  4. Arch

Author

Generated automatically by Doxygen for libstdc++ from the source code.

From gcc 16.2.1+r23+gd564253eb6c8-1 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.