diff --git a/include/osg/ref_ptr b/include/osg/ref_ptr index e09108282..00b768833 100644 --- a/include/osg/ref_ptr +++ b/include/osg/ref_ptr @@ -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 - ref_ptr(const ref_ptr& 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 - ref_ptr& operator = (const ref_ptr& 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 - bool operator == (const ref_ptr& 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 - bool operator != (const ref_ptr& 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); }