libstdc++
std::bad_alloc Class Reference

#include <new_except.h>

Inheritance diagram for std::bad_alloc:
[legend]

Public Member Functions

_GLIBCXX26_CONSTEXPR bad_alloc (const bad_alloc &)=default
_GLIBCXX26_CONSTEXPR bad_allocoperator= (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.

Definition at line 54 of file new_except.h.

Constructor & Destructor Documentation

◆ bad_alloc()

_GLIBCXX26_CONSTEXPR std::bad_alloc::bad_alloc ( )
throw ( )
inline

Definition at line 57 of file new_except.h.

◆ ~bad_alloc()

virtual constexpr std::bad_alloc::~bad_alloc ( )
inlineconstexprvirtualnoexcept

Definition at line 66 of file new_except.h.

Member Function Documentation

◆ what()

virtual constexpr const char * std::bad_alloc::what ( ) const
inlineconstexprvirtualnoexcept

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

Reimplemented from std::exception.

Definition at line 69 of file new_except.h.


The documentation for this class was generated from the following file: