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:
parent
56bc3ae194
commit
e7bfc59f5a
@ -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,7 +69,8 @@ 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; }
|
||||
T* get() const { return _ptr; }
|
||||
|
Loading…
Reference in New Issue
Block a user