Add/use exception_detail::enable_both

This commit is contained in:
Peter Dimov
2018-09-27 07:39:18 +03:00
parent a732dfad3c
commit 56dd1c4111
2 changed files with 13 additions and 1 deletions

View File

@ -472,6 +472,18 @@ boost
{ {
return exception_detail::clone_impl<T>(x); return exception_detail::clone_impl<T>(x);
} }
namespace
exception_detail
{
template <class T>
inline
clone_impl<typename enable_error_info_return_type<T>::type>
enable_both( T const & x )
{
return enable_current_exception( enable_error_info( x ) );
}
}
} }
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) #if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)

View File

@ -67,7 +67,7 @@ template<class E> BOOST_NORETURN inline void throw_exception( E const & e )
throw_exception_assert_compatibility(e); throw_exception_assert_compatibility(e);
#ifndef BOOST_EXCEPTION_DISABLE #ifndef BOOST_EXCEPTION_DISABLE
throw enable_current_exception(enable_error_info(e)); throw exception_detail::enable_both( e );
#else #else
throw e; throw e;
#endif #endif