Delen via


make_exception_ptr

Creates an exception_ptr object that holds a copy of an exception.

template <class E> 
    exception_ptr make_exception_ptr(E Except);

Parameters

  • Except
    The class with the exception to copy. Usually, you specify an exception class object as the argument to the make_exception_ptr function, although any class object can be the argument.

Return Value

An exception_ptr object pointing to a copy of the current exception for Except.

Remarks

Calling the make_exception_ptr function is equivalent to throwing a C++ exception, catching it in a catch block, and then calling the current_exception function to return an exception_ptr object that references the exception. The Microsoft implementation of the make_exception_ptr function is more efficient than throwing and then catching an exception.

An application typically does not require the make_exception_ptr function, and we discourage its use.

See Also

Reference

<exception>

Transporting Exceptions Between Threads