add Equals and HashCode to managed pointer MCefRefPtr

This commit is contained in:
chillitom
2010-12-09 19:13:39 +08:00
committed by Dmitry Azaraev
parent edee098fda
commit 58dd73a2dc
+15
View File
@@ -96,6 +96,21 @@ public:
swap(%r._ptr);
}
virtual bool Equals(Object^ obj) override
{
if(obj->GetType() == GetType())
{
MCefRefPtr^ other = safe_cast<MCefRefPtr^>(obj);
return (*other)._ptr == _ptr;
}
return false;
}
virtual int GetHashCode() override
{
return (int)_ptr;
}
private:
T* _ptr;
};