30 #ifndef _GLIBCXX_NESTED_EXCEPTION_H 31 #define _GLIBCXX_NESTED_EXCEPTION_H 1 33 #pragma GCC visibility push(default) 35 #if __cplusplus < 201103L 42 #if ATOMIC_INT_LOCK_FREE < 2 43 # error This platform does not support exception propagation. 71 rethrow_nested()
const 79 nested_ptr()
const noexcept
83 template<
typename _Except>
86 explicit _Nested_exception(
const _Except& __ex)
90 explicit _Nested_exception(_Except&& __ex)
91 : _Except(static_cast<_Except&&>(__ex))
95 template<
typename _Tp,
97 struct _Throw_with_nested_impl
99 template<
typename _Up>
100 static void _S_throw(_Up&& __t)
101 {
throw _Nested_exception<_Tp>{
static_cast<_Up&&
>(__t)}; }
104 template<
typename _Tp>
105 struct _Throw_with_nested_impl<_Tp, false>
107 template<
typename _Up>
108 static void _S_throw(_Up&& __t)
109 {
throw static_cast<_Up&&
>(__t); }
112 template<
typename _Tp,
bool = __is_
class(_Tp) && !__is_final(_Tp)>
113 struct _Throw_with_nested_helper : _Throw_with_nested_impl<_Tp>
116 template<
typename _Tp>
117 struct _Throw_with_nested_helper<_Tp, false>
118 : _Throw_with_nested_impl<_Tp, false>
121 template<
typename _Tp>
122 struct _Throw_with_nested_helper<_Tp&,
false>
123 : _Throw_with_nested_helper<_Tp>
126 template<
typename _Tp>
127 struct _Throw_with_nested_helper<_Tp&&,
false>
128 : _Throw_with_nested_helper<_Tp>
133 template<
typename _Tp>
138 _Throw_with_nested_helper<_Tp>::_S_throw(static_cast<_Tp&&>(__t));
141 template<
typename _Tp,
bool = __is_polymorphic(_Tp)>
142 struct _Rethrow_if_nested_impl
144 static void _S_rethrow(
const _Tp& __t)
148 __tp->rethrow_nested();
152 template<
typename _Tp>
153 struct _Rethrow_if_nested_impl<_Tp, false>
155 static void _S_rethrow(
const _Tp&) { }
159 template<
typename _Ex>
163 _Rethrow_if_nested_impl<_Ex>::_S_rethrow(__ex);
173 #pragma GCC visibility pop 175 #endif // _GLIBCXX_NESTED_EXCEPTION_H _Tp * __addressof(_Tp &__r) noexcept
Same as C++11 std::addressof.
ISO C++ entities toplevel namespace is std.
void terminate() noexcept __attribute__((__noreturn__))
void throw_with_nested(_Tp &&__t)
If __t is derived from nested_exception, throws __t. Else, throws an implementation-defined object de...
void rethrow_if_nested(const _Ex &__ex)
If __ex is derived from nested_exception, __ex.rethrow_nested().
Exception class with exception_ptr data member.
void rethrow_exception(exception_ptr) __attribute__((__noreturn__))
Throw the object pointed to by the exception_ptr.
exception_ptr current_exception() noexcept