Title: [165425] trunk/Source/WTF
- Revision
- 165425
- Author
- [email protected]
- Date
- 2014-03-10 20:08:01 -0700 (Mon, 10 Mar 2014)
Log Message
Improve WeakPtr operators.
https://bugs.webkit.org/show_bug.cgi?id=130053
Reviewed by Andreas Kling.
Replace the "operator!()" with an explicit bool operator. Add an "operator->()".
* wtf/WeakPtr.h:
(WTF::WeakPtr::operator bool):
(WTF::WeakPtr::operator->):
Modified Paths
Diff
Modified: trunk/Source/WTF/ChangeLog (165424 => 165425)
--- trunk/Source/WTF/ChangeLog 2014-03-11 02:39:40 UTC (rev 165424)
+++ trunk/Source/WTF/ChangeLog 2014-03-11 03:08:01 UTC (rev 165425)
@@ -1,3 +1,16 @@
+2014-03-10 Jer Noble <[email protected]>
+
+ Improve WeakPtr operators.
+ https://bugs.webkit.org/show_bug.cgi?id=130053
+
+ Reviewed by Andreas Kling.
+
+ Replace the "operator!()" with an explicit bool operator. Add an "operator->()".
+
+ * wtf/WeakPtr.h:
+ (WTF::WeakPtr::operator bool):
+ (WTF::WeakPtr::operator->):
+
2014-03-10 Brent Fulgham <[email protected]>
[Win] Pass environment to Pre-Build, Pre-Link, and Post-Build Stages.
Modified: trunk/Source/WTF/wtf/WeakPtr.h (165424 => 165425)
--- trunk/Source/WTF/wtf/WeakPtr.h 2014-03-11 02:39:40 UTC (rev 165424)
+++ trunk/Source/WTF/wtf/WeakPtr.h 2014-03-11 03:08:01 UTC (rev 165425)
@@ -100,8 +100,10 @@
WeakPtr(PassRefPtr<WeakReference<T>> ref) : m_ref(ref) { }
T* get() const { return m_ref->get(); }
- bool operator!() const { return !m_ref->get(); }
+ explicit operator bool() const { return m_ref->get(); }
+ T* operator->() const { return m_ref->get(); }
+
private:
RefPtr<WeakReference<T>> m_ref;
};
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes