std::make_exception_ptr - cppreference.com (original) (raw)

Creates an std::exception_ptr that holds a reference to a copy of e. This is done as if executing the following code:

[edit] Parameters

e - exception object to create a reference to the copy of

[edit] Return value

An instance of std::exception_ptr holding a reference to the copy of e, or to an instance of std::bad_alloc or to an instance of std::bad_exception (see std::current_exception).

[edit] Notes

The parameter is passed by value and is subject to slicing.

Feature-test macro Value Std Feature
__cpp_lib_constexpr_exceptions 202411L (C++26) constexpr for exception types

[edit] Example

[edit] See also