Thrive
hash.h
1 #pragma once
2 
3 #include <functional>
4 
5 namespace std {
6 
10 template<>
11 struct hash<std::pair<int, int>> {
12 public:
13 
21  std::size_t operator() (const std::pair<int, int>& pair) const {
22  // See stackoverflow.com/a/738234/1184818
23  size_t seed = intHash(pair.first);
24  return intHash(pair.second) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
25  }
26 
27 private:
28 
29  const std::hash<int> intHash;
30 
31 };
32 
33 }
Definition: collision_system.h:158