From 0d205cd71ffebf2e0e5748bc29a61c103d217046 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Tue, 25 Jan 2022 19:54:15 +0200 Subject: [PATCH] Use enable_current_exception instead of wrapexcept in copy_exception --- include/boost/exception/detail/exception_ptr.hpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) 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