aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/ref.hh
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2021-06-25 14:43:06 +0200
committerEelco Dolstra <edolstra@gmail.com>2021-07-09 14:03:48 +0200
commit07790fdddf7705454310633b9e38bd816d23de8e (patch)
treeca3879899463fd7ae7b057a4177cd7db6ced6817 /src/libutil/ref.hh
parent9cf991f421b20a2c753df1f93730ddc8ddf7af6c (diff)
ref: Add equality operators
Diffstat (limited to 'src/libutil/ref.hh')
-rw-r--r--src/libutil/ref.hh10
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>