inline void rethrow_exception( exception_ptr const & p ) { BOOST_ASSERT(p); if( p.bad_alloc_ ) throw enable_current_exception(std::bad_alloc()); else p.c_->rethrow(); }
template<class E> BOOST_ATTRIBUTE_NORETURN inline void throw_exception( E const & e ) { //All boost exceptions are required to derive from std::exception, //to ensure compatibility with BOOST_NO_EXCEPTIONS. throw_exception_assert_compatibility(e); #ifndef BOOST_EXCEPTION_DISABLE throw enable_current_exception(enable_error_info(e)); #else throw e; #endif }
inline exception_ptr copy_exception( T const & e ) { try { throw enable_current_exception(e); } catch( ... ) { return current_exception(); } }