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 #ifdef __GXX_EXPERIMENTAL_CXX0X__
96 : _M_exception_object(0)
100 : _M_exception_object(__o._M_exception_object)
101 { __o._M_exception_object = 0; }
104 #if !defined (__GXX_EXPERIMENTAL_CXX0X__) || defined (_GLIBCXX_EH_PTR_COMPAT)
114 #ifdef __GXX_EXPERIMENTAL_CXX0X__
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 #ifdef __GXX_EXPERIMENTAL_CXX0X__
138 explicit operator bool()
const
139 {
return _M_exception_object; }
144 _GLIBCXX_USE_NOEXCEPT __attribute__ ((__pure__));
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
exception_ptr current_exception() _GLIBCXX_USE_NOEXCEPT
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) _GLIBCXX_USE_NOEXCEPT
Obtain an exception_ptr pointing to a copy of the supplied object.
exception_ptr copy_exception(_Ex __ex) _GLIBCXX_USE_NOEXCEPT
Obtain an exception_ptr pointing to a copy of the supplied object.