Reverted the ref_ptr<> implementation to prior implicit cast operator via

commenting out// #define AUTOMATIC_CAST_TO_POINTER.
This commit is contained in:
Robert Osfield 2003-03-06 13:45:20 +00:00
parent 352204f358
commit 0d9aaa5ca6

View File

@ -14,7 +14,7 @@
#ifndef OSG_REF_PTR
#define OSG_REF_PTR 1
#define AUTOMATIC_CAST_TO_POINTER
// #define AUTOMATIC_CAST_TO_POINTER
namespace osg {
@ -56,47 +56,19 @@ class ref_ptr
}
#ifndef AUTOMATIC_CAST_TO_POINTER
inline bool operator == (const ref_ptr& rp) const
{
return (_ptr==rp._ptr);
}
inline bool operator != (const ref_ptr& rp) const
{
return (_ptr!=rp._ptr);
}
inline bool operator < (const ref_ptr& rp) const
{
return (_ptr<rp._ptr);
}
inline bool operator > (const ref_ptr& rp) const
{
return (_ptr>rp._ptr);
}
inline bool operator == (const T* ptr) const
{
return (_ptr==ptr);
}
inline bool operator != (const T* ptr) const
{
return (_ptr!=ptr);
}
inline bool operator < (const T* ptr) const
{
return (_ptr<ptr);
}
inline bool operator > (const T* ptr) const
{
return (_ptr>ptr);
}
// comparison operators for ref_ptr.
inline bool operator == (const ref_ptr& rp) const { return (_ptr==rp._ptr); }
inline bool operator != (const ref_ptr& rp) const { return (_ptr!=rp._ptr); }
inline bool operator < (const ref_ptr& rp) const { return (_ptr<rp._ptr); }
inline bool operator > (const ref_ptr& rp) const { return (_ptr>rp._ptr); }
#endif
// comparion operator for const T*.
inline bool operator == (const T* ptr) const { return (_ptr==ptr); }
inline bool operator != (const T* ptr) const { return (_ptr!=ptr); }
inline bool operator < (const T* ptr) const { return (_ptr<ptr); }
inline bool operator > (const T* ptr) const { return (_ptr>ptr); }
inline T& operator*() { return *_ptr; }