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
77 void* _M_exception_object;
81 void _M_addref() _GLIBCXX_USE_NOEXCEPT;
82 void _M_release() _GLIBCXX_USE_NOEXCEPT;
84 void *_M_get()
const _GLIBCXX_NOEXCEPT __attribute__ ((__pure__));
94 #if __cplusplus >= 201103L
96 : _M_exception_object(0)
100 : _M_exception_object(__o._M_exception_object)
101 { __o._M_exception_object = 0; }
104 #if (__cplusplus < 201103L) || defined (_GLIBCXX_EH_PTR_COMPAT)
114 #if __cplusplus >= 201103L
118 exception_ptr(static_cast<exception_ptr&&>(__o)).swap(*
this);
128 #ifdef _GLIBCXX_EH_PTR_COMPAT
130 void _M_safe_bool_dummy() _GLIBCXX_USE_NOEXCEPT
131 __attribute__ ((__const__));
132 bool operator!()
const _GLIBCXX_USE_NOEXCEPT
133 __attribute__ ((__pure__));
134 operator __safe_bool()
const _GLIBCXX_USE_NOEXCEPT;
137 #if __cplusplus >= 201103L
138 explicit operator bool()
const
139 {
return _M_exception_object; }
144 _GLIBCXX_USE_NOEXCEPT __attribute__ ((__pure__));
146 const class std::type_info*
147 __cxa_exception_type()
const _GLIBCXX_USE_NOEXCEPT
148 __attribute__ ((__pure__));
153 _GLIBCXX_USE_NOEXCEPT __attribute__ ((__pure__));
157 _GLIBCXX_USE_NOEXCEPT __attribute__ ((__pure__));
160 swap(exception_ptr& __lhs, exception_ptr& __rhs)
161 { __lhs.swap(__rhs); }
167 template<
typename _Ex>
186 template<
typename _Ex>
189 {
return std::copy_exception<_Ex>(__ex); }
196 #pragma GCC visibility pop
An opaque pointer to an arbitrary exception.
exception_ptr current_exception() noexcept
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
Obtain an exception_ptr pointing to a copy of the supplied object.
ISO C++ entities toplevel namespace is std.
void rethrow_exception(exception_ptr) __attribute__((__noreturn__))
Throw the object pointed to by the exception_ptr.
void swap(_Tp &, _Tp &) noexcept(__and_< is_nothrow_move_constructible< _Tp >, is_nothrow_move_assignable< _Tp >>::value)
Swaps two values.