diff --git a/include/boost/exception/exception.hpp b/include/boost/exception/exception.hpp index be70b3c..1460473 100644 --- a/include/boost/exception/exception.hpp +++ b/include/boost/exception/exception.hpp @@ -472,6 +472,18 @@ boost { return exception_detail::clone_impl(x); } + + namespace + exception_detail + { + template + inline + clone_impl::type> + enable_both( T const & x ) + { + return enable_current_exception( enable_error_info( x ) ); + } + } } #if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) diff --git a/include/boost/throw_exception.hpp b/include/boost/throw_exception.hpp index a96dded..c6623e1 100644 --- a/include/boost/throw_exception.hpp +++ b/include/boost/throw_exception.hpp @@ -67,7 +67,7 @@ template BOOST_NORETURN inline void throw_exception( E const & e ) throw_exception_assert_compatibility(e); #ifndef BOOST_EXCEPTION_DISABLE - throw enable_current_exception(enable_error_info(e)); + throw exception_detail::enable_both( e ); #else throw e; #endif