added Ptr::operator==

This commit is contained in:
Anatoly Baksheev
2012-12-15 22:09:21 +04:00
parent aabb40e34d
commit 94c310fc14
6 changed files with 12 additions and 5 deletions

View File

@@ -1284,6 +1284,8 @@ public:
operator _Tp* ();
operator const _Tp*() const;
bool operator==(const Ptr<_Tp>& ptr) const;
_Tp* obj; //< the object pointer.
int* refcount; //< the associated reference counter
};

View File

@@ -2690,6 +2690,11 @@ template<typename _Tp> template<typename _Tp2> inline const Ptr<_Tp2> Ptr<_Tp>::
return p;
}
template<typename _Tp> inline bool Ptr<_Tp>::operator==(const Ptr<_Tp>& _ptr) const
{
return refcount == _ptr.refcount;
}
//// specializied implementations of Ptr::delete_obj() for classic OpenCV types
template<> CV_EXPORTS void Ptr<CvMat>::delete_obj();