Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1466)

Unified Diff: third_party/WebKit/Source/wtf/PassOwnPtr.h

Issue 1878253003: Allow explicit conversion operators and implement WTF::OwnPtr::operator bool. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/wtf/PassOwnPtr.h
diff --git a/third_party/WebKit/Source/wtf/PassOwnPtr.h b/third_party/WebKit/Source/wtf/PassOwnPtr.h
index ad3190d3b7027559486b9bdf06305a31356f03b3..131cb381798fbc7a3498bdcbf64db7bf16be3618 100644
--- a/third_party/WebKit/Source/wtf/PassOwnPtr.h
+++ b/third_party/WebKit/Source/wtf/PassOwnPtr.h
@@ -64,11 +64,7 @@ public:
PtrType operator->() const { ASSERT(m_ptr); return m_ptr; }
bool operator!() const { return !m_ptr; }
-
- // This conversion operator allows implicit conversion to bool but not to
- // other integer types.
- typedef PtrType PassOwnPtr::*UnspecifiedBoolType;
- operator UnspecifiedBoolType() const { return m_ptr ? &PassOwnPtr::m_ptr : 0; }
+ explicit operator bool() const { return m_ptr; }
danakj 2016/04/12 23:23:24 ditto?
template <typename U> friend PassOwnPtr<U> adoptPtr(U*);
template <typename U> friend PassOwnPtr<U[]> adoptArrayPtr(U*);
« third_party/WebKit/Source/wtf/OwnPtr.h ('K') | « third_party/WebKit/Source/wtf/OwnPtr.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698