31 #ifndef _EXCEPTION_PTR_H 32 #define _EXCEPTION_PTR_H 34 #pragma GCC visibility push(default) 39 #if ATOMIC_INT_LOCK_FREE < 2 40 # error This platform does not support exception propagation. 53 namespace __exception_ptr
58 using __exception_ptr::exception_ptr;
69 namespace __exception_ptr
79 void* _M_exception_object;
83 void _M_addref() _GLIBCXX_USE_NOEXCEPT;
84 void _M_release() _GLIBCXX_USE_NOEXCEPT;
86 void *_M_get()
const _GLIBCXX_NOEXCEPT __attribute__ ((__pure__));
96 #if __cplusplus >= 201103L 98 : _M_exception_object(0)
102 : _M_exception_object(__o._M_exception_object)
103 { __o._M_exception_object = 0; }
106 #if (__cplusplus < 201103L) || defined (_GLIBCXX_EH_PTR_COMPAT) 116 #if __cplusplus >= 201103L 120 exception_ptr(static_cast<exception_ptr&&>(__o)).swap(*
this);
130 #ifdef _GLIBCXX_EH_PTR_COMPAT 132 void _M_safe_bool_dummy() _GLIBCXX_USE_NOEXCEPT
133 __attribute__ ((__const__));
134 bool operator!()
const _GLIBCXX_USE_NOEXCEPT
135 __attribute__ ((__pure__));
136 operator __safe_bool()
const _GLIBCXX_USE_NOEXCEPT;
139 #if __cplusplus >= 201103L 140 explicit operator bool()
const 141 {
return _M_exception_object; }
146 _GLIBCXX_USE_NOEXCEPT __attribute__ ((__pure__));
149 __cxa_exception_type()
const _GLIBCXX_USE_NOEXCEPT
150 __attribute__ ((__pure__));
155 _GLIBCXX_USE_NOEXCEPT __attribute__ ((__pure__));
159 _GLIBCXX_USE_NOEXCEPT __attribute__ ((__pure__));
163 { __lhs.swap(__rhs); }
169 template<
typename _Ex>
183 return exception_ptr();
191 template<
typename _Ex>
193 copy_exception(_Ex __ex) _GLIBCXX_USE_NOEXCEPT _GLIBCXX_DEPRECATED;
195 template<
typename _Ex>
198 {
return std::make_exception_ptr<_Ex>(__ex); }
205 #pragma GCC visibility pop
An opaque pointer to an arbitrary exception.
void rethrow_exception(exception_ptr) __attribute__((__noreturn__))
Throw the object pointed to by the exception_ptr.
exception_ptr make_exception_ptr(_Ex __ex) noexcept
Obtain an exception_ptr pointing to a copy of the supplied object.
exception_ptr copy_exception(_Ex __ex) noexcept 1
Obtain an exception_ptr pointing to a copy of the supplied object. This function is deprecated...
exception_ptr current_exception() noexcept
ISO C++ entities toplevel namespace is std.