]> code.bitgloo.com Git - clyne/entityx.git/commitdiff
std::hash for const Entity implemented.
authorFrank Stein <dr.frank.stain@gmail.com>
Fri, 21 Oct 2016 22:04:15 +0000 (00:04 +0200)
committerFrank Stein <dr.frank.stain@gmail.com>
Fri, 21 Oct 2016 22:04:15 +0000 (00:04 +0200)
entityx/Entity.h

index 9fcf67661d3c21b882bc42874793eecd851e206c..e4a3871b477238e590dce4f7369adcabf978f8ec 100644 (file)
@@ -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());
+  }
+};
 }