diff options
Diffstat (limited to 'libstdc++-v3/libsupc++/exception_ptr.h')
-rw-r--r-- | libstdc++-v3/libsupc++/exception_ptr.h | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/libstdc++-v3/libsupc++/exception_ptr.h b/libstdc++-v3/libsupc++/exception_ptr.h index f3f0819b1c6..4ccb4fb2d6e 100644 --- a/libstdc++-v3/libsupc++/exception_ptr.h +++ b/libstdc++-v3/libsupc++/exception_ptr.h @@ -81,25 +81,27 @@ namespace std void *_M_get() const throw() __attribute__ ((__pure__)); - void _M_safe_bool_dummy() throw() __attribute__ ((__const__)); - friend exception_ptr std::current_exception() throw(); friend void std::rethrow_exception(exception_ptr); public: exception_ptr() throw(); - typedef void (exception_ptr::*__safe_bool)(); - - // For construction from nullptr or 0. - exception_ptr(__safe_bool) throw(); - exception_ptr(const exception_ptr&) throw(); #ifdef __GXX_EXPERIMENTAL_CXX0X__ + exception_ptr(nullptr_t) throw() + : _M_exception_object(0) + { } + exception_ptr(exception_ptr&& __o) throw() : _M_exception_object(__o._M_exception_object) { __o._M_exception_object = 0; } +#else + typedef void (exception_ptr::*__safe_bool)(); + + // For construction from nullptr or 0. + exception_ptr(__safe_bool) throw(); #endif exception_ptr& @@ -121,10 +123,16 @@ namespace std #ifdef _GLIBCXX_EH_PTR_COMPAT // Retained for compatibility with CXXABI_1.3. + void _M_safe_bool_dummy() throw() __attribute__ ((__const__)); bool operator!() const throw() __attribute__ ((__pure__)); operator __safe_bool() const throw(); #endif +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + explicit operator bool() const + { return _M_exception_object; } +#endif + friend bool operator==(const exception_ptr&, const exception_ptr&) throw() __attribute__ ((__pure__)); @@ -140,6 +148,11 @@ namespace std bool operator!=(const exception_ptr&, const exception_ptr&) throw() __attribute__ ((__pure__)); + + inline void + swap(exception_ptr& __lhs, exception_ptr& __rhs) + { __lhs.swap(__rhs); } + } // namespace __exception_ptr |