copy_exception/make_exception_ptr implemented via wrapexcept rather than throw/catch

This commit is contained in:
Emil Dotchevski
2020-08-11 19:40:30 -07:00
parent 330008445c
commit 7e8f0cd9bb

View File

@ -76,20 +76,13 @@ boost
}
};
template <class T>
template <class E>
inline
exception_ptr
copy_exception( T const & e )
copy_exception( E const & e )
{
try
{
throw enable_current_exception(e);
}
catch(
... )
{
return current_exception();
}
wrapexcept<E> * w = new wrapexcept<E>(e);
return exception_ptr(shared_ptr<wrapexcept<E> >(w));
}
template <class T>