From 7e8f0cd9bb72194729e653853a8ffc4ceec488b3 Mon Sep 17 00:00:00 2001 From: Emil Dotchevski Date: Tue, 11 Aug 2020 19:40:30 -0700 Subject: [PATCH] copy_exception/make_exception_ptr implemented via wrapexcept rather than throw/catch --- include/boost/exception/detail/exception_ptr.hpp | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) 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