Changeset 165425 in webkit


Ignore:
Timestamp:
Mar 10, 2014 8:08:01 PM (10 years ago)
Author:
jer.noble@apple.com
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->):

Location:
trunk/Source/WTF
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r165393 r165425  
     12014-03-10  Jer Noble  <jer.noble@apple.com>
     2
     3        Improve WeakPtr operators.
     4        https://bugs.webkit.org/show_bug.cgi?id=130053
     5
     6        Reviewed by Andreas Kling.
     7
     8        Replace the "operator!()" with an explicit bool operator.  Add an "operator->()".
     9
     10        * wtf/WeakPtr.h:
     11        (WTF::WeakPtr::operator bool):
     12        (WTF::WeakPtr::operator->):
     13
    1142014-03-10  Brent Fulgham  <bfulgham@apple.com>
    215
  • trunk/Source/WTF/wtf/WeakPtr.h

    r157653 r165425  
    101101
    102102    T* get() const { return m_ref->get(); }
    103     bool operator!() const { return !m_ref->get(); }
     103    explicit operator bool() const { return m_ref->get(); }
     104
     105    T* operator->() const { return m_ref->get(); }
    104106
    105107private:
Note: See TracChangeset for help on using the changeset viewer.