aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlec Thomas <alec@swapoff.org>2016-10-23 10:12:00 +1100
committerGitHub <noreply@github.com>2016-10-23 10:12:00 +1100
commit017e5dc5510b6a462f1f6df05137fc43d4be61be (patch)
treec10f3bf35d7a91eaeaef47bbf33a3d4b14fabc9f
parente90226d0df9fac990a7bac1d625133363302960e (diff)
parent8a53139f94bdea60099723528079a6a514764f3a (diff)
Merge pull request #154 from FrankStain/master
std::hash for const Entity implemented. #153
-rw-r--r--entityx/Entity.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/entityx/Entity.h b/entityx/Entity.h
index 9fcf676..e4a3871 100644
--- a/entityx/Entity.h
+++ b/entityx/Entity.h
@@ -1079,5 +1079,11 @@ template <> struct hash<entityx::Entity> {
return static_cast<std::size_t>(entity.id().index() ^ entity.id().version());
}
};
+
+template <> struct hash<const entityx::Entity> {
+ std::size_t operator () (const entityx::Entity &entity) const {
+ return static_cast<std::size_t>(entity.id().index() ^ entity.id().version());
+ }
+};
}