Repository: mesos
Updated Branches:
  refs/heads/master 477d49a2f -> 0d247c388


Added hash function for mesos::UUID.

Review: https://reviews.apache.org/r/65587/


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/4c4ee457
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/4c4ee457
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/4c4ee457

Branch: refs/heads/master
Commit: 4c4ee4575667e721f710cbf5a09ba3ec94001672
Parents: 477d49a
Author: Benjamin Bannier <benjamin.bann...@mesosphere.io>
Authored: Tue Mar 6 16:01:55 2018 +0100
Committer: Benjamin Bannier <bbann...@apache.org>
Committed: Tue Mar 6 16:01:55 2018 +0100

----------------------------------------------------------------------
 include/mesos/type_utils.hpp | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/4c4ee457/include/mesos/type_utils.hpp
----------------------------------------------------------------------
diff --git a/include/mesos/type_utils.hpp b/include/mesos/type_utils.hpp
index 2fff71f..df95319 100644
--- a/include/mesos/type_utils.hpp
+++ b/include/mesos/type_utils.hpp
@@ -761,6 +761,22 @@ struct hash<mesos::ResourceProviderID>
   }
 };
 
+
+template <>
+struct hash<mesos::UUID>
+{
+  typedef size_t result_type;
+
+  typedef mesos::UUID argument_type;
+
+  result_type operator()(const argument_type& uuid) const
+  {
+    size_t seed = 0;
+    boost::hash_combine(seed, uuid.value());
+    return seed;
+  }
+};
+
 } // namespace std {
 
 #endif // __MESOS_TYPE_UTILS_H__

Reply via email to