RefCount: Fix reference counting pointer == and != with a T* on the left.
These operators were expecting a const T& instead of a const T*, and were not being picked up and used by gcc in the right places as a result. Apparently no one used these operators before. A unit test which exposed these problems, verified the solution, and checks other basic functionality is on the way.
This commit is contained in:
parent
5e25f31712
commit
1a10ccc5e5
1 changed files with 2 additions and 2 deletions
|
@ -109,7 +109,7 @@ bool operator==(const RefCountingPtr<T> &l, const T *r)
|
|||
{ return l.get() == r; }
|
||||
|
||||
template<class T>
|
||||
bool operator==(const T &l, const RefCountingPtr<T> &r)
|
||||
bool operator==(const T *l, const RefCountingPtr<T> &r)
|
||||
{ return l == r.get(); }
|
||||
|
||||
template<class T>
|
||||
|
@ -121,7 +121,7 @@ bool operator!=(const RefCountingPtr<T> &l, const T *r)
|
|||
{ return l.get() != r; }
|
||||
|
||||
template<class T>
|
||||
bool operator!=(const T &l, const RefCountingPtr<T> &r)
|
||||
bool operator!=(const T *l, const RefCountingPtr<T> &r)
|
||||
{ return l != r.get(); }
|
||||
|
||||
#endif // __BASE_REFCNT_HH__
|
||||
|
|
Loading…
Reference in a new issue