Changeset 28926 in webkit for trunk/JavaScriptCore/wtf/OwnPtr.h


Ignore:
Timestamp:
Dec 20, 2007, 10:06:37 PM (17 years ago)
Author:
Darin Adler
Message:

Reviewed by Sam.

  • wtf/OwnPtr.h: (WTF::operator==): Added. (WTF::operator!=): Added.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/wtf/OwnPtr.h

    r25934 r28926  
    9393    template <typename T> inline void swap(OwnPtr<T>& a, OwnPtr<T>& b) { a.swap(b); }
    9494
     95    template <typename T, typename U> inline bool operator==(const OwnPtr<T>& a, U* b)
     96    {
     97        return a.get() == b;
     98    }
     99   
     100    template <typename T, typename U> inline bool operator==(T* a, const OwnPtr<U>& b)
     101    {
     102        return a == b.get();
     103    }
     104
     105    template <typename T, typename U> inline bool operator!=(const OwnPtr<T>& a, U* b)
     106    {
     107        return a.get() != b;
     108    }
     109
     110    template <typename T, typename U> inline bool operator!=(T* a, const OwnPtr<U>& b)
     111    {
     112        return a != b.get();
     113    }
     114   
    95115    template <typename T> inline typename OwnPtr<T>::PtrType getPtr(const OwnPtr<T>& p)
    96116    {
Note: See TracChangeset for help on using the changeset viewer.