Take a copy of the exception currently being handled in the innermost enclosing
catch block, and store it
in an instance of std::exception_ptr.
std::exception_ptr current_exception();
- Returns:
If an exception is currently being handled, then an
std::exception_ptrinstance that refers to that exception, otherwise a default-constructedstd::exception_ptrinstance. If memory must be allocated for the stored exception, and the attempt to allocate memory fails, then the result is anstd::exception_ptrinstance that refers to an exception of typestd::bad_alloc. If the exception must be copied, and the copy-constructor of the currently-handled exception throws another exception then either anstd::exception_ptrobject that references that exception or anstd::exception_ptrobject that references an exception of typestd::bad_exceptionshall be returned.- Throws:
Nothing.
Header
#include <exception_ptr>