forked from boostorg/throw_exception
Merge branch 'feature/wrapexcept' into develop
This commit is contained in:
@ -472,6 +472,51 @@ boost
|
|||||||
{
|
{
|
||||||
return exception_detail::clone_impl<T>(x);
|
return exception_detail::clone_impl<T>(x);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <class T>
|
||||||
|
struct
|
||||||
|
BOOST_SYMBOL_VISIBLE
|
||||||
|
wrapexcept:
|
||||||
|
public exception_detail::clone_impl<typename exception_detail::enable_error_info_return_type<T>::type>
|
||||||
|
{
|
||||||
|
typedef exception_detail::clone_impl<typename exception_detail::enable_error_info_return_type<T>::type> base_type;
|
||||||
|
public:
|
||||||
|
explicit
|
||||||
|
wrapexcept( typename exception_detail::enable_error_info_return_type<T>::type const & x ):
|
||||||
|
base_type( x )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
~wrapexcept() throw()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
namespace
|
||||||
|
exception_detail
|
||||||
|
{
|
||||||
|
template <class T>
|
||||||
|
struct
|
||||||
|
remove_error_info_injector
|
||||||
|
{
|
||||||
|
typedef T type;
|
||||||
|
};
|
||||||
|
|
||||||
|
template <class T>
|
||||||
|
struct
|
||||||
|
remove_error_info_injector< error_info_injector<T> >
|
||||||
|
{
|
||||||
|
typedef T type;
|
||||||
|
};
|
||||||
|
|
||||||
|
template <class T>
|
||||||
|
inline
|
||||||
|
wrapexcept<typename remove_error_info_injector<T>::type>
|
||||||
|
enable_both( T const & x )
|
||||||
|
{
|
||||||
|
return wrapexcept<typename remove_error_info_injector<T>::type>( enable_error_info( x ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
|
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
|
||||||
|
@ -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
|
||||||
|
Reference in New Issue
Block a user