diff options
author | 2018-01-12 12:29:09 -0800 | |
---|---|---|
committer | 2018-01-12 12:29:09 -0800 | |
commit | 94dad609783b0e67c9b4b1de079330e19cf813c2 (patch) | |
tree | 37bfae3e7a328917f267b1667573ae66e13a0929 /src/core/lib/support | |
parent | 324703db51b43e150d9d8ffbcceb9d2096e26a9f (diff) |
Add equality operators to RefCountedPtr.
Diffstat (limited to 'src/core/lib/support')
-rw-r--r-- | src/core/lib/support/ref_counted_ptr.h | 13 |
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; }; |