Removed template methods that were break VS6.0 build.
This commit is contained in:
parent
c986f6ea41
commit
7a42716036
@ -27,9 +27,6 @@ class ref_ptr
|
||||
ref_ptr(T* ptr) : _ptr(ptr) { if (_ptr) _ptr->ref(); }
|
||||
ref_ptr(const ref_ptr& rp) : _ptr(rp._ptr) { if (_ptr) _ptr->ref(); }
|
||||
|
||||
template<class Y>
|
||||
ref_ptr(const ref_ptr<Y>& rp) : _ptr(rp.get()) { if (_ptr) _ptr->ref(); }
|
||||
|
||||
~ref_ptr() { if (_ptr) _ptr->unref(); _ptr = 0; }
|
||||
|
||||
ref_ptr& operator = (const ref_ptr& rp)
|
||||
@ -45,20 +42,6 @@ class ref_ptr
|
||||
return *this;
|
||||
}
|
||||
|
||||
template<class Y>
|
||||
ref_ptr& operator = (const ref_ptr<Y>& rp)
|
||||
{
|
||||
if (_ptr==rp._ptr) return *this;
|
||||
T* tmp_ptr = _ptr;
|
||||
_ptr = rp._ptr;
|
||||
if (_ptr) _ptr->ref();
|
||||
// unref second to prevent any deletion of any object which might
|
||||
// be referenced by the other object. i.e rp is child of the
|
||||
// original _ptr.
|
||||
if (tmp_ptr) tmp_ptr->unref();
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline ref_ptr& operator = (T* ptr)
|
||||
{
|
||||
if (_ptr==ptr) return *this;
|
||||
@ -73,13 +56,11 @@ class ref_ptr
|
||||
}
|
||||
|
||||
// comparison operators for ref_ptr.
|
||||
template<class Y>
|
||||
bool operator == (const ref_ptr<Y>& rp) const { return (_ptr==rp.get()); }
|
||||
bool operator == (const ref_ptr& rp) const { return (_ptr==rp._ptr); }
|
||||
bool operator == (const T* ptr) const { return (_ptr==ptr); }
|
||||
friend bool operator == (const T* ptr, const ref_ptr& rp) { return (ptr==rp._ptr); }
|
||||
|
||||
template<class Y>
|
||||
bool operator != (const ref_ptr<Y>& rp) const { return (_ptr!=rp.get()); }
|
||||
bool operator != (const ref_ptr& rp) const { return (_ptr!=rp._ptr); }
|
||||
bool operator != (const T* ptr) const { return (_ptr!=ptr); }
|
||||
friend bool operator != (const T* ptr, const ref_ptr& rp) { return (ptr!=rp._ptr); }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user