31 #ifndef _EXCEPTION_PTR_H 32 #define _EXCEPTION_PTR_H 34 #pragma GCC visibility push(default) 42 #if ATOMIC_INT_LOCK_FREE < 2 43 # error This platform does not support exception propagation. 56 namespace __exception_ptr
61 using __exception_ptr::exception_ptr;
69 template<typename _Ex>
75 namespace __exception_ptr
85 void* _M_exception_object;
89 void _M_addref() _GLIBCXX_USE_NOEXCEPT;
90 void _M_release() _GLIBCXX_USE_NOEXCEPT;
92 void *_M_get()
const _GLIBCXX_NOEXCEPT __attribute__ ((__pure__));
96 template<
typename _Ex>
104 #if __cplusplus >= 201103L 106 : _M_exception_object(0)
110 : _M_exception_object(__o._M_exception_object)
111 { __o._M_exception_object = 0; }
114 #if (__cplusplus < 201103L) || defined (_GLIBCXX_EH_PTR_COMPAT) 124 #if __cplusplus >= 201103L 128 exception_ptr(static_cast<exception_ptr&&>(__o)).swap(*
this);
138 #ifdef _GLIBCXX_EH_PTR_COMPAT 140 void _M_safe_bool_dummy() _GLIBCXX_USE_NOEXCEPT
141 __attribute__ ((__const__));
142 bool operator!()
const _GLIBCXX_USE_NOEXCEPT
143 __attribute__ ((__pure__));
144 operator __safe_bool()
const _GLIBCXX_USE_NOEXCEPT;
147 #if __cplusplus >= 201103L 148 explicit operator bool()
const 149 {
return _M_exception_object; }
154 _GLIBCXX_USE_NOEXCEPT __attribute__ ((__pure__));
157 __cxa_exception_type()
const _GLIBCXX_USE_NOEXCEPT
158 __attribute__ ((__pure__));
163 _GLIBCXX_USE_NOEXCEPT __attribute__ ((__pure__));
167 _GLIBCXX_USE_NOEXCEPT __attribute__ ((__pure__));
171 { __lhs.swap(__rhs); }
173 template<
typename _Ex>
175 __dest_thunk(
void* x)
176 {
static_cast<_Ex*
>(x)->~_Ex(); }
181 template<
typename _Ex>
188 #if __cpp_rtti && !_GLIBCXX_HAVE_CDTOR_CALLABI 189 void *__e = __cxxabiv1::__cxa_allocate_exception(
sizeof(_Ex));
190 (void)__cxxabiv1::__cxa_init_primary_exception(
191 __e, const_cast<std::type_info*>(&
typeid(__ex)),
192 __exception_ptr::__dest_thunk<_Ex>);
193 ::new (__e) _Ex(__ex);
212 template<
typename _Ex>
214 copy_exception(_Ex __ex) _GLIBCXX_USE_NOEXCEPT _GLIBCXX_DEPRECATED;
216 template<
typename _Ex>
219 {
return std::make_exception_ptr<_Ex>(__ex); }
226 #pragma GCC visibility pop An opaque pointer to an arbitrary exception.
exception_ptr copy_exception(_Ex __ex) noexcept 1
Obtain an exception_ptr pointing to a copy of the supplied object. This function is deprecated...
void rethrow_exception(exception_ptr) __attribute__((__noreturn__))
Throw the object pointed to by the exception_ptr.
ISO C++ entities toplevel namespace is std.
exception_ptr make_exception_ptr(_Ex) noexcept
Obtain an exception_ptr pointing to a copy of the supplied object.
exception_ptr current_exception() noexcept