From Neil Groves, addition on a T* implicit output conversion method and removal of comparison methods that are replaced by the single conversion method.

From Robert Osfield, optional compilation of above.
This commit is contained in:
Robert Osfield 2008-10-03 15:13:11 +00:00
parent 56bc3ae194
commit e7bfc59f5a

View File

@ -55,6 +55,10 @@ class ref_ptr
return *this;
}
#ifdef OSG_USE_REF_PTR_IMPLICIT_OUTPUT_CONVERSION
// implicit output conversion
operator T*() const { return _ptr; }
#else
// comparison operators for ref_ptr.
bool operator == (const ref_ptr& rp) const { return (_ptr==rp._ptr); }
bool operator == (const T* ptr) const { return (_ptr==ptr); }
@ -65,6 +69,7 @@ class ref_ptr
friend bool operator != (const T* ptr, const ref_ptr& rp) { return (ptr!=rp._ptr); }
bool operator < (const ref_ptr& rp) const { return (_ptr<rp._ptr); }
#endif
T& operator*() const { return *_ptr; }
T* operator->() const { return _ptr; }