diff --git a/src/libutil/ref.hh b/src/libutil/ref.hh
index 0be2a7e74ae04211e464a90839d8370b648169ce..2549ef4960e69de7ee64757c12068b733414a427 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>