Merge pull request #41 from boostorg/pr/copy-exception

Use enable_current_exception instead of wrapexcept in copy_exception
This commit is contained in:
Emil Dotchevski
2022-01-25 19:39:39 -08:00
committed by GitHub

View File

@ -112,14 +112,24 @@ boost
} }
}; };
namespace
exception_detail
{
template <class E>
inline
exception_ptr
copy_exception_impl( E const & e )
{
return exception_ptr(boost::make_shared<E>(e));
}
}
template <class E> template <class E>
inline inline
exception_ptr exception_ptr
copy_exception( E const & e ) copy_exception( E const & e )
{ {
E cp = e; return exception_detail::copy_exception_impl(boost::enable_current_exception(e));
exception_detail::copy_boost_exception(&cp, &e);
return exception_ptr(boost::make_shared<wrapexcept<E> >(cp));
} }
template <class T> template <class T>