diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2021-06-25 14:43:06 +0200 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2021-07-09 14:03:48 +0200 |
commit | 07790fdddf7705454310633b9e38bd816d23de8e (patch) | |
tree | ca3879899463fd7ae7b057a4177cd7db6ced6817 | |
parent | 9cf991f421b20a2c753df1f93730ddc8ddf7af6c (diff) |
ref: Add equality operators
-rw-r--r-- | src/libutil/ref.hh | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/libutil/ref.hh b/src/libutil/ref.hh index 0be2a7e74..2549ef496 100644 --- a/src/libutil/ref.hh +++ b/src/libutil/ref.hh @@ -73,6 +73,16 @@ public: return ref<T2>((std::shared_ptr<T2>) p); } + bool operator == (const ref<T> & other) const + { + return p == other.p; + } + + bool operator != (const ref<T> & other) const + { + return p != other.p; + } + private: template<typename T2, typename... Args> |