diff options
author | Alec Thomas <alec@swapoff.org> | 2016-10-23 10:12:00 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-23 10:12:00 +1100 |
commit | 017e5dc5510b6a462f1f6df05137fc43d4be61be (patch) | |
tree | c10f3bf35d7a91eaeaef47bbf33a3d4b14fabc9f | |
parent | e90226d0df9fac990a7bac1d625133363302960e (diff) | |
parent | 8a53139f94bdea60099723528079a6a514764f3a (diff) |
Merge pull request #154 from FrankStain/master
std::hash for const Entity implemented. #153
-rw-r--r-- | entityx/Entity.h | 6 |
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()); + } +}; } |