Ticket #8966: ptr-fix.patch

File ptr-fix.patch, 915 bytes (added by peres, 15 years ago)

Makes operator==() a member of SharedPtr.

  • ptr.h

     
    180180                _pointer = 0;
    181181        }
    182182
     183    template <class T2>
     184    bool operator==(const Common::SharedPtr<T2> &r) const {
     185        return get() == r.get();
     186    }
     187
     188    template <class T2>
     189    bool operator!=(const Common::SharedPtr<T2> &r) const {
     190        return get() != r.get();
     191    }
     192
    183193        /**
    184194         * Returns the number of references to the assigned pointer.
    185195         * This should just be used for debugging purposes.
     
    208218
    209219} // end of namespace Common
    210220
    211 template<class T1, class T2>
    212 bool operator==(const Common::SharedPtr<T1> &l, const Common::SharedPtr<T2> &r) {
    213         return l.get() == r.get();
    214 }
    215 
    216 template<class T1, class T2>
    217 bool operator!=(const Common::SharedPtr<T1> &l, const Common::SharedPtr<T2> &r) {
    218         return l.get() != r.get();
    219 }
    220 
    221221#endif