Chromium Code Reviews| Index: third_party/WebKit/Source/wtf/OwnPtr.h |
| diff --git a/third_party/WebKit/Source/wtf/OwnPtr.h b/third_party/WebKit/Source/wtf/OwnPtr.h |
| index 0b0b58e081883b6b114a5ab04d6c8a17cf6d1f28..391031ca4c7d93c088c901d09990ba9f88cbaf18 100644 |
| --- a/third_party/WebKit/Source/wtf/OwnPtr.h |
| +++ b/third_party/WebKit/Source/wtf/OwnPtr.h |
| @@ -70,11 +70,7 @@ public: |
| ValueType& operator[](std::ptrdiff_t i) const; |
| bool operator!() const { return !m_ptr; } |
| - |
| - // This conversion operator allows implicit conversion to bool but not to |
| - // other integer types. |
| - typedef PtrType OwnPtr::*UnspecifiedBoolType; |
| - operator UnspecifiedBoolType() const { return m_ptr ? &OwnPtr::m_ptr : 0; } |
| + explicit operator bool() const { return m_ptr; } |
|
danakj
2016/04/12 23:23:24
do you mean return !!m_ptr?
not sure if this leak
jbroman
2016/04/12 23:26:38
No, conversion to bool will result in either |true
danakj
2016/04/12 23:30:11
Yay thanks
|
| OwnPtr& operator=(const PassOwnPtr<T>&); |
| OwnPtr& operator=(std::nullptr_t) { clear(); return *this; } |