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.
51 namespace __exception_ptr
56 using __exception_ptr::exception_ptr;
67 namespace __exception_ptr
75 void* _M_exception_object;
79 void _M_addref() _GLIBCXX_USE_NOEXCEPT;
80 void _M_release() _GLIBCXX_USE_NOEXCEPT;
82 void *_M_get()
const _GLIBCXX_NOEXCEPT __attribute__ ((__pure__));
92 #ifdef __GXX_EXPERIMENTAL_CXX0X__
94 : _M_exception_object(0)
98 : _M_exception_object(__o._M_exception_object)
99 { __o._M_exception_object = 0; }
102 #if !defined (__GXX_EXPERIMENTAL_CXX0X__) || defined (_GLIBCXX_EH_PTR_COMPAT)
112 #ifdef __GXX_EXPERIMENTAL_CXX0X__
116 exception_ptr(static_cast<exception_ptr&&>(__o)).swap(*
this);
126 #ifdef _GLIBCXX_EH_PTR_COMPAT
128 void _M_safe_bool_dummy() _GLIBCXX_USE_NOEXCEPT
129 __attribute__ ((__const__));
130 bool operator!()
const _GLIBCXX_USE_NOEXCEPT
131 __attribute__ ((__pure__));
132 operator __safe_bool()
const _GLIBCXX_USE_NOEXCEPT;
135 #ifdef __GXX_EXPERIMENTAL_CXX0X__
136 explicit operator bool()
const
137 {
return _M_exception_object; }
142 _GLIBCXX_USE_NOEXCEPT __attribute__ ((__pure__));
145 __cxa_exception_type()
const _GLIBCXX_USE_NOEXCEPT
146 __attribute__ ((__pure__));
151 _GLIBCXX_USE_NOEXCEPT __attribute__ ((__pure__));
155 _GLIBCXX_USE_NOEXCEPT __attribute__ ((__pure__));
158 swap(exception_ptr& __lhs, exception_ptr& __rhs)
159 { __lhs.swap(__rhs); }
165 template<
typename _Ex>
184 template<
typename _Ex>
187 {
return std::copy_exception<_Ex>(__ex); }
194 #pragma GCC visibility pop