31 #ifndef _EXCEPTION_PTR_H
32 #define _EXCEPTION_PTR_H
34 #pragma GCC visibility push(default)
49 namespace __exception_ptr
54 using __exception_ptr::exception_ptr;
65 namespace __exception_ptr
73 void* _M_exception_object;
77 void _M_addref() _GLIBCXX_USE_NOEXCEPT;
78 void _M_release() _GLIBCXX_USE_NOEXCEPT;
80 void *_M_get()
const _GLIBCXX_NOEXCEPT __attribute__ ((__pure__));
90 #if __cplusplus >= 201103L
92 : _M_exception_object(0)
96 : _M_exception_object(__o._M_exception_object)
97 { __o._M_exception_object = 0; }
100 #if (__cplusplus < 201103L) || defined (_GLIBCXX_EH_PTR_COMPAT)
110 #if __cplusplus >= 201103L
114 exception_ptr(static_cast<exception_ptr&&>(__o)).swap(*
this);
124 #ifdef _GLIBCXX_EH_PTR_COMPAT
126 void _M_safe_bool_dummy() _GLIBCXX_USE_NOEXCEPT
127 __attribute__ ((__const__));
128 bool operator!()
const _GLIBCXX_USE_NOEXCEPT
129 __attribute__ ((__pure__));
130 operator __safe_bool()
const _GLIBCXX_USE_NOEXCEPT;
133 #if __cplusplus >= 201103L
134 explicit operator bool()
const
135 {
return _M_exception_object; }
140 _GLIBCXX_USE_NOEXCEPT __attribute__ ((__pure__));
142 const class std::type_info*
143 __cxa_exception_type()
const _GLIBCXX_USE_NOEXCEPT
144 __attribute__ ((__pure__));
149 _GLIBCXX_USE_NOEXCEPT __attribute__ ((__pure__));
153 _GLIBCXX_USE_NOEXCEPT __attribute__ ((__pure__));
156 swap(exception_ptr& __lhs, exception_ptr& __rhs)
157 { __lhs.swap(__rhs); }
163 template<
typename _Ex>
183 template<
typename _Ex>
185 copy_exception(_Ex __ex) _GLIBCXX_USE_NOEXCEPT _GLIBCXX_DEPRECATED;
187 template<
typename _Ex>
190 {
return std::make_exception_ptr<_Ex>(__ex); }
197 #pragma GCC visibility pop
exception_ptr current_exception() noexcept
An opaque pointer to an arbitrary exception.
exception_ptr copy_exception(_Ex __ex) noexcept 1
Obtain an exception_ptr pointing to a copy of the supplied object. This function is deprecated...
ISO C++ entities toplevel namespace is std.
void rethrow_exception(exception_ptr) __attribute__((__noreturn__))
Throw the object pointed to by the exception_ptr.
exception_ptr make_exception_ptr(_Ex __ex) noexcept
Obtain an exception_ptr pointing to a copy of the supplied object.
void swap(_Tp &, _Tp &) noexcept(__and_< is_nothrow_move_constructible< _Tp >, is_nothrow_move_assignable< _Tp >>::value)
Swaps two values.