libstdc++
Exceptions
Collaboration diagram for Exceptions:

Classes

class  __cxxabiv1::__forced_unwind
 
struct  __gnu_cxx::forced_error
 
class  __gnu_cxx::recursive_init_error
 
class  std::__exception_ptr::exception_ptr
 
class  std::bad_alloc
 
class  std::bad_cast
 
class  std::bad_function_call
 
class  std::bad_typeid
 
class  std::bad_weak_ptr
 
class  std::domain_error
 
class  std::exception
 
class  std::experimental::fundamentals_v1::bad_any_cast
 
class  std::experimental::fundamentals_v1::bad_optional_access
 
class  std::future_error
 
class  std::invalid_argument
 
class  std::ios_base::failure
 
class  std::length_error
 
class  std::logic_error
 
class  std::nested_exception
 
class  std::out_of_range
 
class  std::overflow_error
 
class  std::range_error
 
class  std::regex_error
 
class  std::runtime_error
 
class  std::system_error
 
class  std::underflow_error
 

Typedefs

template<typename _Tp >
using std::__rethrow_if_nested_cond = typename enable_if< __and_< is_polymorphic< _Tp >, __or_< __not_< is_base_of< nested_exception, _Tp > >, is_convertible< _Tp *, nested_exception * > > >::value >::type
 

Functions

 std::_Nested_exception< _Except >::_Nested_exception (_Except &&__ex)
 
 std::_Nested_exception< _Except >::_Nested_exception (const _Except &__ex)
 
 std::domain_error::domain_error (const char *) _GLIBCXX_TXN_SAFE
 
 std::domain_error::domain_error (const string &__arg) _GLIBCXX_TXN_SAFE
 
 std::__exception_ptr::exception_ptr::exception_ptr (const exception_ptr &) noexcept
 
 std::__exception_ptr::exception_ptr::exception_ptr (exception_ptr &&__o) noexcept
 
 std::__exception_ptr::exception_ptr::exception_ptr (nullptr_t) noexcept
 
 std::invalid_argument::invalid_argument (const char *) _GLIBCXX_TXN_SAFE
 
 std::invalid_argument::invalid_argument (const string &__arg) _GLIBCXX_TXN_SAFE
 
 std::length_error::length_error (const char *) _GLIBCXX_TXN_SAFE
 
 std::length_error::length_error (const string &__arg) _GLIBCXX_TXN_SAFE
 
 std::logic_error::logic_error (const char *) _GLIBCXX_TXN_SAFE
 
 std::logic_error::logic_error (const string &__arg) _GLIBCXX_TXN_SAFE
 
 std::nested_exception::nested_exception (const nested_exception &) noexcept=default
 
 std::out_of_range::out_of_range (const char *) _GLIBCXX_TXN_SAFE
 
 std::out_of_range::out_of_range (const string &__arg) _GLIBCXX_TXN_SAFE
 
 std::overflow_error::overflow_error (const char *) _GLIBCXX_TXN_SAFE
 
 std::overflow_error::overflow_error (const string &__arg) _GLIBCXX_TXN_SAFE
 
 std::range_error::range_error (const char *) _GLIBCXX_TXN_SAFE
 
 std::range_error::range_error (const string &__arg) _GLIBCXX_TXN_SAFE
 
 std::runtime_error::runtime_error (const char *) _GLIBCXX_TXN_SAFE
 
 std::runtime_error::runtime_error (const string &__arg) _GLIBCXX_TXN_SAFE
 
 std::underflow_error::underflow_error (const char *) _GLIBCXX_TXN_SAFE
 
 std::underflow_error::underflow_error (const string &__arg) _GLIBCXX_TXN_SAFE
 
const class std::type_infostd::__exception_ptr::exception_ptr::__cxa_exception_type () const noexcept __attribute__((__pure__))
 
template<typename _Ex >
void std::__exception_ptr::__dest_thunk (void *__x)
 
template<typename _Ex >
__rethrow_if_nested_cond< _Ex > std::__rethrow_if_nested_impl (const _Ex *__ptr)
 
void std::__rethrow_if_nested_impl (const void *)
 
template<typename _Tp >
void std::__throw_with_nested_impl (_Tp &&__t, false_type)
 
template<typename _Tp >
void std::__throw_with_nested_impl (_Tp &&__t, true_type)
 
void __gnu_cxx::__verbose_terminate_handler ()
 
exception_ptr std::current_exception () noexcept
 
template<typename _Ex >
exception_ptr std::make_exception_ptr (_Ex __ex) noexcept
 
exception_ptr std::nested_exception::nested_ptr () const noexcept
 
 std::__exception_ptr::exception_ptr::operator bool () const
 
bool std::__exception_ptr::operator!= (const exception_ptr &, const exception_ptr &) noexcept __attribute__((__pure__))
 
exception_ptrstd::__exception_ptr::exception_ptr::operator= (const exception_ptr &) noexcept
 
nested_exceptionstd::nested_exception::operator= (const nested_exception &) noexcept=default
 
exception_ptrstd::__exception_ptr::exception_ptr::operator= (exception_ptr &&__o) noexcept
 
bool std::__exception_ptr::operator== (const exception_ptr &, const exception_ptr &) noexcept __attribute__((__pure__))
 
void std::rethrow_exception (exception_ptr) __attribute__((__noreturn__))
 
template<typename _Ex >
void std::rethrow_if_nested (const _Ex &__ex)
 
void std::nested_exception::rethrow_nested () const
 
void std::__exception_ptr::exception_ptr::swap (exception_ptr &) noexcept
 
void std::__exception_ptr::swap (exception_ptr &__lhs, exception_ptr &__rhs)
 
template<typename _Tp >
void std::throw_with_nested (_Tp &&__t)
 
virtual const char * std::exception::what () const _GLIBCXX_TXN_SAFE_DYN noexcept
 
virtual const char * std::logic_error::what () const _GLIBCXX_TXN_SAFE_DYN noexcept
 
virtual const char * std::runtime_error::what () const _GLIBCXX_TXN_SAFE_DYN noexcept
 

Friends

bool std::__exception_ptr::exception_ptr::operator== (const exception_ptr &, const exception_ptr &) noexcept __attribute__((__pure__))
 
exception_ptr std::__exception_ptr::exception_ptr::std::current_exception () noexcept
 
template<typename _Ex >
exception_ptr std::__exception_ptr::exception_ptr::std::make_exception_ptr (_Ex) noexcept
 
void std::__exception_ptr::exception_ptr::std::rethrow_exception (exception_ptr)
 

Detailed Description

Classes and functions for reporting errors via exception classes.

Typedef Documentation

◆ __rethrow_if_nested_cond

template<typename _Tp >
using std::__rethrow_if_nested_cond = typedef typename enable_if< __and_<is_polymorphic<_Tp>, __or_<__not_<is_base_of<nested_exception, _Tp> >, is_convertible<_Tp*, nested_exception*> >>::value >::type

Definition at line 128 of file nested_exception.h.

Function Documentation

◆ _Nested_exception() [1/2]

template<typename _Except >
std::_Nested_exception< _Except >::_Nested_exception ( _Except &&  __ex)
inlineexplicit

Definition at line 86 of file nested_exception.h.

◆ _Nested_exception() [2/2]

template<typename _Except >
std::_Nested_exception< _Except >::_Nested_exception ( const _Except &  __ex)
inlineexplicit

Definition at line 82 of file nested_exception.h.

◆ exception()

std::exception::exception ( )
inlinenoexcept

Definition at line 63 of file exception.h.

◆ exception_ptr() [1/2]

std::__exception_ptr::exception_ptr::exception_ptr ( exception_ptr &&  __o)
inlinenoexcept

Definition at line 105 of file exception_ptr.h.

◆ exception_ptr() [2/2]

std::__exception_ptr::exception_ptr::exception_ptr ( nullptr_t  )
inlinenoexcept

Definition at line 101 of file exception_ptr.h.

◆ logic_error()

std::logic_error::logic_error ( const string __arg)
explicit

Takes a character string describing the error.

◆ nested_exception()

std::nested_exception::nested_exception ( )
inlinenoexcept

Definition at line 57 of file nested_exception.h.

◆ runtime_error()

std::runtime_error::runtime_error ( const string __arg)
explicit

Takes a character string describing the error.

◆ __dest_thunk()

template<typename _Ex >
void std::__exception_ptr::__dest_thunk ( void *  __x)
inline

Definition at line 171 of file exception_ptr.h.

◆ __rethrow_if_nested_impl() [1/2]

template<typename _Ex >
__rethrow_if_nested_cond< _Ex > std::__rethrow_if_nested_impl ( const _Ex *  __ptr)
inline

Definition at line 137 of file nested_exception.h.

◆ __rethrow_if_nested_impl() [2/2]

void std::__rethrow_if_nested_impl ( const void *  )
inline

Definition at line 145 of file nested_exception.h.

◆ __throw_with_nested_impl() [1/2]

template<typename _Tp >
void std::__throw_with_nested_impl ( _Tp &&  __t,
false_type   
)
inline

Definition at line 106 of file nested_exception.h.

◆ __throw_with_nested_impl() [2/2]

template<typename _Tp >
void std::__throw_with_nested_impl ( _Tp &&  __t,
true_type   
)
inline

Definition at line 97 of file nested_exception.h.

◆ __verbose_terminate_handler()

void __gnu_cxx::__verbose_terminate_handler ( )

A replacement for the standard terminate_handler which prints more information about the terminating exception (if any) on stderr.

Call

void __verbose_terminate_handler()
A replacement for the standard terminate_handler which prints more information about the terminating ...
terminate_handler set_terminate(terminate_handler) noexcept
Takes a new handler function as an argument, returns the old function.

to use. For more info, see http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt02ch06s02.html

In 3.4 and later, this is on by default.

◆ current_exception()

exception_ptr std::current_exception ( )
noexcept

Obtain an exception_ptr to the currently handled exception. If there is none, or the currently handled exception is foreign, return the null value.

Referenced by std::make_exception_ptr().

◆ make_exception_ptr()

template<typename _Ex >
exception_ptr std::make_exception_ptr ( _Ex  __ex)
noexcept

Obtain an exception_ptr pointing to a copy of the supplied object.

Definition at line 179 of file exception_ptr.h.

References std::current_exception().

◆ nested_ptr()

exception_ptr std::nested_exception::nested_ptr ( ) const
inlinenoexcept

Definition at line 75 of file nested_exception.h.

◆ operator bool()

std::__exception_ptr::exception_ptr::operator bool ( ) const
inlineexplicit

Definition at line 144 of file exception_ptr.h.

◆ operator=()

exception_ptr & std::__exception_ptr::exception_ptr::operator= ( exception_ptr &&  __o)
inlinenoexcept

Definition at line 122 of file exception_ptr.h.

◆ rethrow_exception()

void std::rethrow_exception ( exception_ptr  )

Throw the object pointed to by the exception_ptr.

References std::rethrow_exception().

Referenced by std::rethrow_exception().

◆ rethrow_if_nested()

template<typename _Ex >
void std::rethrow_if_nested ( const _Ex &  __ex)
inline

If __ex is derived from nested_exception, __ex.rethrow_nested().

Definition at line 151 of file nested_exception.h.

References std::__addressof().

◆ rethrow_nested()

void std::nested_exception::rethrow_nested ( ) const
inline

Definition at line 67 of file nested_exception.h.

◆ swap()

void std::__exception_ptr::swap ( exception_ptr __lhs,
exception_ptr __rhs 
)
inline

Definition at line 166 of file exception_ptr.h.

◆ throw_with_nested()

template<typename _Tp >
void std::throw_with_nested ( _Tp &&  __t)
inline

If __t is derived from nested_exception, throws __t. Else, throws an implementation-defined object derived from both.

Definition at line 114 of file nested_exception.h.

◆ what() [1/3]

virtual const char * std::exception::what ( ) const
virtualnoexcept

◆ what() [2/3]

virtual const char * std::logic_error::what ( ) const
virtualnoexcept

Returns a C-style character string describing the general cause of the current error (the same string passed to the ctor).

Reimplemented from std::exception.

Reimplemented in std::future_error.

◆ what() [3/3]

virtual const char * std::runtime_error::what ( ) const
virtualnoexcept

Returns a C-style character string describing the general cause of the current error (the same string passed to the ctor).

Reimplemented from std::exception.