summaryrefslogtreecommitdiff
path: root/libstdc++-v3/libsupc++/exception_ptr.h
diff options
context:
space:
mode:
authorhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>2010-07-01 22:22:57 +0000
committerhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>2010-07-01 22:22:57 +0000
commit9e169c4bf36a38689550c059570c57efbf00a6fb (patch)
tree95e6800f7ac2a49ff7f799d96f04172320e70ac0 /libstdc++-v3/libsupc++/exception_ptr.h
parent6170dfb6edfb7b19f8ae5209b8f948fe0076a4ad (diff)
downloadgcc-vect256.tar.gz
Merged trunk at revision 161680 into branch.vect256
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/vect256@161681 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/libsupc++/exception_ptr.h')
-rw-r--r--libstdc++-v3/libsupc++/exception_ptr.h27
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