Documentation Home >> Headers >> <exception_ptr> Header >> std::copy_exception Function Template

Create an std::exception_ptr instance referencing a stored exception that is a copy of the supplied object.

template<typename ExceptionType>
std::exception_ptr copy_exception(ExceptionType e);

Effects:

As-if

try
{
    throw e;
}
catch(...)
{
    return std::current_exception();
}
Throws:

Nothing.

Header

#include <exception_ptr>

See Also