From 94dad609783b0e67c9b4b1de079330e19cf813c2 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Fri, 12 Jan 2018 12:29:09 -0800 Subject: Add equality operators to RefCountedPtr. --- src/core/lib/support/ref_counted_ptr.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/core/lib/support/ref_counted_ptr.h') diff --git a/src/core/lib/support/ref_counted_ptr.h b/src/core/lib/support/ref_counted_ptr.h index dc2385e369..83e99d8ca6 100644 --- a/src/core/lib/support/ref_counted_ptr.h +++ b/src/core/lib/support/ref_counted_ptr.h @@ -76,6 +76,19 @@ class RefCountedPtr { T& operator*() const { return *value_; } T* operator->() const { return value_; } + bool operator==(const RefCountedPtr& other) const { + return value_ == other.value_; + } + bool operator==(T* other) const { + return value_ == other; + } + bool operator!=(const RefCountedPtr& other) const { + return value_ != other.value_; + } + bool operator!=(T* other) const { + return value_ != other; + } + private: T* value_ = nullptr; }; -- cgit v1.2.3