diff --git a/include/boost/exception/detail/exception_ptr.hpp b/include/boost/exception/detail/exception_ptr.hpp index a9222d9..21b35e3 100644 --- a/include/boost/exception/detail/exception_ptr.hpp +++ b/include/boost/exception/detail/exception_ptr.hpp @@ -76,20 +76,13 @@ boost } }; - template + template inline exception_ptr - copy_exception( T const & e ) + copy_exception( E const & e ) { - try - { - throw enable_current_exception(e); - } - catch( - ... ) - { - return current_exception(); - } + wrapexcept * w = new wrapexcept(e); + return exception_ptr(shared_ptr >(w)); } template