From: Frank Stein Date: Fri, 21 Oct 2016 22:04:15 +0000 (+0200) Subject: std::hash for const Entity implemented. X-Git-Url: https://code.bitgloo.com/?a=commitdiff_plain;h=8a53139f94bdea60099723528079a6a514764f3a;p=clyne%2Fentityx.git std::hash for const Entity implemented. --- 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 { return static_cast(entity.id().index() ^ entity.id().version()); } }; + +template <> struct hash { + std::size_t operator () (const entityx::Entity &entity) const { + return static_cast(entity.id().index() ^ entity.id().version()); + } +}; }