...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
#include <boost/exception_ptr.hpp>
namespace
boost
{
exception_ptr current_exception();
}
The current_exception function must not be called outside of a catch block.
In addition, to safely copy an exception from one thread to another, if the exception object is copied by current_exception or copy_exception, the two copies must not have shared state. Exceptions that have value-type semantics (as well as the boost::exception type itself) satisfy this requirement.
Nothing.