diff --git a/include/boost/exception/detail/exception_ptr.hpp b/include/boost/exception/detail/exception_ptr.hpp index c3b97b9..3621529 100644 --- a/include/boost/exception/detail/exception_ptr.hpp +++ b/include/boost/exception/detail/exception_ptr.hpp @@ -112,14 +112,24 @@ boost } }; + namespace + exception_detail + { + template + inline + exception_ptr + copy_exception_impl( E const & e ) + { + return exception_ptr(boost::make_shared(e)); + } + } + template inline exception_ptr copy_exception( E const & e ) { - E cp = e; - exception_detail::copy_boost_exception(&cp, &e); - return exception_ptr(boost::make_shared >(cp)); + return exception_detail::copy_exception_impl(boost::enable_current_exception(e)); } template