From e7b1d1aa0cedb1e2a58e20794cf91e68f5647f42 Mon Sep 17 00:00:00 2001 From: Teon Banek Date: Wed, 17 Jul 2019 10:31:13 +0200 Subject: [PATCH] Add std::hash for V2 (Edge|Vertex)Accessor Reviewers: mferencevic, mtomic Reviewed By: mferencevic Subscribers: pullbot Differential Revision: https://phabricator.memgraph.io/D2212 --- src/storage/v2/edge_accessor.hpp | 9 +++++++++ src/storage/v2/vertex_accessor.hpp | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/src/storage/v2/edge_accessor.hpp b/src/storage/v2/edge_accessor.hpp index 30f0af6f7..14a28d82c 100644 --- a/src/storage/v2/edge_accessor.hpp +++ b/src/storage/v2/edge_accessor.hpp @@ -55,3 +55,12 @@ class EdgeAccessor final { }; } // namespace storage + +namespace std { +template <> +struct hash { + size_t operator()(const storage::EdgeAccessor &e) const { + return e.Gid().AsUint(); + } +}; +} // namespace std diff --git a/src/storage/v2/vertex_accessor.hpp b/src/storage/v2/vertex_accessor.hpp index 3dfec2e32..079e1e258 100644 --- a/src/storage/v2/vertex_accessor.hpp +++ b/src/storage/v2/vertex_accessor.hpp @@ -60,3 +60,12 @@ class VertexAccessor final { }; } // namespace storage + +namespace std { +template <> +struct hash { + size_t operator()(const storage::VertexAccessor &v) const { + return v.Gid().AsUint(); + } +}; +} // namespace std