31 #ifndef _EXCEPTION_PTR_H 32 #define _EXCEPTION_PTR_H 34 #pragma GCC visibility push(default) 52 namespace __exception_ptr
57 using __exception_ptr::exception_ptr;
65 template<typename _Ex>
71 namespace __exception_ptr
81 void* _M_exception_object;
85 void _M_addref() _GLIBCXX_USE_NOEXCEPT;
86 void _M_release() _GLIBCXX_USE_NOEXCEPT;
88 void *_M_get()
const _GLIBCXX_NOEXCEPT __attribute__ ((__pure__));
92 template<
typename _Ex>
100 #if __cplusplus >= 201103L 102 : _M_exception_object(0)
106 : _M_exception_object(__o._M_exception_object)
107 { __o._M_exception_object = 0; }
110 #if (__cplusplus < 201103L) || defined (_GLIBCXX_EH_PTR_COMPAT) 120 #if __cplusplus >= 201103L 124 exception_ptr(static_cast<exception_ptr&&>(__o)).swap(*
this);
134 #ifdef _GLIBCXX_EH_PTR_COMPAT 136 void _M_safe_bool_dummy() _GLIBCXX_USE_NOEXCEPT
137 __attribute__ ((__const__));
138 bool operator!()
const _GLIBCXX_USE_NOEXCEPT
139 __attribute__ ((__pure__));
140 operator __safe_bool()
const _GLIBCXX_USE_NOEXCEPT;
143 #if __cplusplus >= 201103L 144 explicit operator bool()
const 145 {
return _M_exception_object; }
150 _GLIBCXX_USE_NOEXCEPT __attribute__ ((__pure__));
153 __cxa_exception_type()
const _GLIBCXX_USE_NOEXCEPT
154 __attribute__ ((__pure__));
159 _GLIBCXX_USE_NOEXCEPT __attribute__ ((__pure__));
163 _GLIBCXX_USE_NOEXCEPT __attribute__ ((__pure__));
167 { __lhs.swap(__rhs); }
169 template<
typename _Ex>
171 __dest_thunk(
void* __x)
172 {
static_cast<_Ex*
>(__x)->~_Ex(); }
177 template<
typename _Ex>
184 #if __cpp_rtti && !_GLIBCXX_HAVE_CDTOR_CALLABI 185 void *__e = __cxxabiv1::__cxa_allocate_exception(
sizeof(_Ex));
186 (void)__cxxabiv1::__cxa_init_primary_exception(
187 __e, const_cast<std::type_info*>(&
typeid(__ex)),
188 __exception_ptr::__dest_thunk<_Ex>);
189 ::new (__e) _Ex(__ex);
190 return exception_ptr(__e);
200 return exception_ptr();
208 template<
typename _Ex>
210 copy_exception(_Ex __ex) _GLIBCXX_USE_NOEXCEPT _GLIBCXX_DEPRECATED;
212 template<
typename _Ex>
215 {
return std::make_exception_ptr<_Ex>(__ex); }
222 #pragma GCC visibility pop exception_ptr make_exception_ptr(_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...
An opaque pointer to an arbitrary exception.
void rethrow_exception(exception_ptr) __attribute__((__noreturn__))
Throw the object pointed to by the exception_ptr.
ISO C++ entities toplevel namespace is std.
exception_ptr current_exception() noexcept