From 9b28b3ccacb494dd0df330073ffd889be31d2700 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Wed, 9 Feb 2011 16:58:15 -0500 Subject: [PATCH] add == and != operator to refptr template --- util/refptr.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/util/refptr.h b/util/refptr.h index 1f33df1..54b7847 100644 --- a/util/refptr.h +++ b/util/refptr.h @@ -17,6 +17,8 @@ class refptr T & operator*() const; T * operator->() const; bool isNull() const { return m_ptr == NULL; } + bool operator==(const refptr & right) const; + bool operator!=(const refptr & right) const; private: void cloneFrom(const refptr & orig); @@ -99,5 +101,15 @@ template T * refptr::operator->() const return m_ptr; } +template bool refptr::operator==(const refptr & right) const +{ + return m_ptr == right.m_ptr; +} + +template bool refptr::operator!=(const refptr & right) const +{ + return m_ptr != right.m_ptr; +} + #endif