<p>In addition, to safely copy an exception from one thread to another, if the exception object is copied by <spanclass="RenoLink">current_exception</span> or <spanclass="RenoLink"><ahref="copy_exception.html">copy_exception</a></span>, the two copies must not have shared state. Exceptions that have value-type semantics (as well as the boost::<spanclass="RenoLink"><ahref="exception.html">exception</a></span> type itself) satisfy this requirement.</p>
<div><ul><li> An <spanclass="RenoLink"><ahref="exception_ptr.html">exception_ptr</a></span> that refers to the currently handled exception or a copy of the currently handled exception.</li>
<li> If the function needs to allocate memory and the attempt fails, it returns an <spanclass="RenoLink"><ahref="exception_ptr.html">exception_ptr</a></span> that refers to an instance of std::bad_alloc.</li>
<div><ul><li> It is unspecified whether the return values of two successive calls to <spanclass="RenoLink">current_exception</span> refer to the same exception object.</li>
<li> Correct implementation of <spanclass="RenoLink">current_exception</span> may require compiler support (e.g. C++11 <ahref="https://en.cppreference.com/w/cpp/error/current_exception">std::current_exception()</a> is used when available, as specified by Boost.Config BOOST_NO_CXX11_HDR_EXCEPTION), unless <spanclass="RenoLink"><ahref="enable_current_exception.html">enable_current_exception</a></span> was used at the time the currently handled exception object was passed to throw. Whenever <spanclass="RenoLink">current_exception</span> fails to properly copy the current exception object, it returns an <spanclass="RenoLink"><ahref="exception_ptr.html">exception_ptr</a></span> to an object of type that is as close as possible to the original exception type, using <spanclass="RenoLink"><ahref="unknown_exception.html">unknown_exception</a></span> as a final fallback. All such types derive from boost::<spanclass="RenoLink"><ahref="exception.html">exception</a></span>, and:<div><ul><li> if the original exception object derives from boost::<spanclass="RenoLink"><ahref="exception.html">exception</a></span>, then the boost::<spanclass="RenoLink"><ahref="exception.html">exception</a></span> sub-object of the object referred to by the returned <spanclass="RenoLink"><ahref="exception_ptr.html">exception_ptr</a></span> is initialized by the boost::<spanclass="RenoLink"><ahref="exception.html">exception</a></span> copy constructor;</li>
<li> if available, the exception contains the std::type_info of the original exception object, accessible through <spanclass="RenoLink"><ahref="get_error_info.html">get_error_info</a></span><<spanclass="RenoLink"><ahref="original_exception_type.html">original_exception_type</a></span>>.</li>