types: Add STL-compliant Hash functor for Qt types
[quassel.git] / src / common / types.h
index a806c58..0816223 100644 (file)
@@ -225,6 +225,16 @@ QDataStream& operator>>(QDataStream& in, T& value)
     return in;
 }
 
+// STL-compliant hash functor for Qt types
+template<typename T>
+struct Hash
+{
+    uint operator()(const T& t) const
+    {
+        return qHash(t);
+    }
+};
+
 // Exceptions
 
 /**