current_exception
Requirements:
The current_exception function must not be called outside of a catch block.
Returns:
- An exception_ptr that refers to the currently handled exception or a copy of the currently handled exception.
- If the function needs to allocate memory and the attempt fails, it returns an exception_ptr that refers to an instance of std::bad_alloc.
Throws:
Nothing.
Notes: