chsvlib
chsv helper source code
nested_exception Class Reference

Together with throw_with_nested and rethrow_if_nested implements a behaviour of the standard C++11 nested exceptions mechanism as defined by the std::nested_exception class and by the std::throw_with_nested and std::rethrow_if_nested functions respectively. . More...

#include <chsvexception.h>

Public Member Functions

 nested_exception () noexcept
 Default constructor using the std::current_exception function to retrieve the current exception having been caught by the caller. Thus, the objects supposed to be default-created in a catch context, or the std::bad_exception will be nested otherwise.
 
 nested_exception (const nested_exception &other) noexcept=default
 Default copy constructor.
 
nested_exceptionoperator= (const nested_exception &other) noexcept=default
 Default copy assign operator.
 
virtual ~nested_exception ()=default
 Destructor.
 
void rethrow_nested () const
 Rethrows the stored exception. If there is no stored exceptions (i.e. nested_ptr returns null pointer), then std::terminate is called.
 
std::exception_ptr nested_ptr () const noexcept
 Returns a pointer to the stored exception, if any.
 

Detailed Description

Together with throw_with_nested and rethrow_if_nested implements a behaviour of the standard C++11 nested exceptions mechanism as defined by the std::nested_exception class and by the std::throw_with_nested and std::rethrow_if_nested functions respectively. .

Warning
Neither the class nor the functions constituting the nested exceptions facility are supposed to be used with any other implementation of nested exceptions, including the one provided by the standard library, if any.

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