cpp/error/exception ptr

is a nullable pointer-like type that manages an exception object which has been thrown and captured with std. An instance of may be passed to another function, possibly on another thread, where the exception may be rethrown and handled with a catch clause.

A default-constructed is a null pointer; it does not point to an exception object.

Two instances of compare equal only if they are both null or both point at the same exception object.

is not implicitly convertible to any arithmetic, enumeration, or pointer type. It is contextually convertible to, and will evaluate to false if it is null, true otherwise.

The exception object referenced by an remains valid as long as there remains at least one  that is referencing it:  is a shared-ownership smart pointer (note: this is in addition to the usual exception object lifetime rules).

meets the requirements of.