diff --git a/Utils.h b/Utils.h index b31121af..440e8d5d 100644 --- a/Utils.h +++ b/Utils.h @@ -413,8 +413,6 @@ public: // Overloaded operators T& operator *() const { assert(m_pType); return *m_pType; } T* operator ->() const { assert(m_pType); return m_pType; } - bool operator ==(T* rhs) const { return (m_pType == rhs); } - bool operator ==(const CSmartPtr& rhs) const { return (m_pType == *rhs); } /** * @brief Attach() to a raw pointer @@ -508,5 +506,14 @@ private: unsigned int* m_puCount; //!< Counter of how many CSmartPtr's are referencing the same raw pointer }; +template +bool operator ==(T* lhs, const CSmartPtr& rhs) { return (lhs == rhs.GetPtr()); } + +template +bool operator ==(const CSmartPtr& lhs, T* rhs) { return (lhs.GetPtr() == rhs); } + +template +bool operator ==(const CSmartPtr& lhs, const CSmartPtr& rhs) { return (lhs.GetPtr() == rhs.GetPtr()); } + #endif // !_UTILS_H