31 #ifndef _EXCEPTION_PTR_H
32 #define _EXCEPTION_PTR_H
34 #pragma GCC visibility push(default)
39 #if !defined(_GLIBCXX_ATOMIC_BUILTINS_4)
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()
throw();
80 void _M_release()
throw();
82 void *_M_get()
const throw() __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; }
110 #ifdef __GXX_EXPERIMENTAL_CXX0X__
114 exception_ptr(static_cast<exception_ptr&&>(__o)).swap(*
this);
124 #ifdef _GLIBCXX_EH_PTR_COMPAT
126 void _M_safe_bool_dummy()
throw() __attribute__ ((__const__));
127 bool operator!()
const throw() __attribute__ ((__pure__));
128 operator __safe_bool()
const throw();
131 #ifdef __GXX_EXPERIMENTAL_CXX0X__
132 explicit operator bool()
const
133 {
return _M_exception_object; }
138 __attribute__ ((__pure__));
141 __cxa_exception_type()
const throw() __attribute__ ((__pure__));
146 __attribute__ ((__pure__));
149 operator!=(const
exception_ptr&, const exception_ptr&) throw()
150 __attribute__ ((__pure__));
153 swap(exception_ptr& __lhs, exception_ptr& __rhs)
154 { __lhs.swap(__rhs); }
160 template<
typename _Ex>
179 template<
typename _Ex>
182 {
return std::copy_exception<_Ex>(__ex); }
189 #pragma GCC visibility pop