Add std::hash for V2 (Edge|Vertex)Accessor

Reviewers: mferencevic, mtomic

Reviewed By: mferencevic

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D2212
This commit is contained in:
Teon Banek 2019-07-17 10:31:13 +02:00
parent 4e1c7c9e34
commit e7b1d1aa0c
2 changed files with 18 additions and 0 deletions

View File

@ -55,3 +55,12 @@ class EdgeAccessor final {
};
} // namespace storage
namespace std {
template <>
struct hash<storage::EdgeAccessor> {
size_t operator()(const storage::EdgeAccessor &e) const {
return e.Gid().AsUint();
}
};
} // namespace std

View File

@ -60,3 +60,12 @@ class VertexAccessor final {
};
} // namespace storage
namespace std {
template <>
struct hash<storage::VertexAccessor> {
size_t operator()(const storage::VertexAccessor &v) const {
return v.Gid().AsUint();
}
};
} // namespace std