From 437cf879808fb68a79e7f8325615737f86f434be Mon Sep 17 00:00:00 2001 From: LaG1924 <12997935+LaG1924@users.noreply.github.com> Date: Sat, 23 Sep 2017 20:55:08 +0500 Subject: 2017-09-23 --- src/Block.hpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'src/Block.hpp') diff --git a/src/Block.hpp b/src/Block.hpp index c3dfcec..12d2907 100644 --- a/src/Block.hpp +++ b/src/Block.hpp @@ -1,5 +1,7 @@ #pragma once +#include + struct Block { Block(); @@ -20,4 +22,17 @@ struct BlockId { bool operator==(const BlockId& lhs, const BlockId &rhs); -bool operator<(const BlockId& lhs, const BlockId &rhs); \ No newline at end of file +bool operator<(const BlockId& lhs, const BlockId &rhs); + +namespace std { + template <> + struct hash { + std::size_t operator()(const BlockId& k) const + { + size_t id = std::hash()(k.id); + size_t state = std::hash()(k.state); + + return (id & state << 1); + } + }; +} \ No newline at end of file -- cgit v1.2.3