aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib/support
diff options
context:
space:
mode:
authorGravatar Mark D. Roth <roth@google.com>2018-01-12 12:29:09 -0800
committerGravatar Mark D. Roth <roth@google.com>2018-01-12 12:29:09 -0800
commit94dad609783b0e67c9b4b1de079330e19cf813c2 (patch)
tree37bfae3e7a328917f267b1667573ae66e13a0929 /src/core/lib/support
parent324703db51b43e150d9d8ffbcceb9d2096e26a9f (diff)
Add equality operators to RefCountedPtr.
Diffstat (limited to 'src/core/lib/support')
-rw-r--r--src/core/lib/support/ref_counted_ptr.h13
1 files changed, 13 insertions, 0 deletions
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;
};