libstdc++
std::nested_exception Class Reference

#include <exception>

Public Member Functions

 nested_exception () noexcept
 
 nested_exception (const nested_exception &) noexcept=default
 
exception_ptr nested_ptr () const noexcept
 
nested_exceptionoperator= (const nested_exception &) noexcept=default
 
void rethrow_nested () const
 

Detailed Description

Mixin class that stores the current exception.

This type can be used via std::throw_with_nested to store the current exception nested within another exception.

Since
C++11
See also
std::throw_with_nested

Definition at line 59 of file nested_exception.h.

Constructor & Destructor Documentation

◆ nested_exception()

std::nested_exception::nested_exception ( )
inlinenoexcept

The default constructor stores the current exception (if any).

Definition at line 65 of file nested_exception.h.

Member Function Documentation

◆ nested_ptr()

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

Access the stored exception.

Definition at line 85 of file nested_exception.h.

◆ rethrow_nested()

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

Rethrow the stored exception, or terminate if none was stored.

Definition at line 76 of file nested_exception.h.

References std::rethrow_exception(), and std::terminate().


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