Advertisement
Guest User

Untitled

a guest
Nov 18th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.39 KB | None | 0 0
  1. typedef std::pair<int, int> Tp;
  2.  
  3. namespace std
  4. {
  5.     template <>
  6.     struct hash<Tp>
  7.     {
  8.         size_t operator()( const Tp& k ) const
  9.         {
  10.             // Compute individual hash values for first, second and third
  11.             // http://stackoverflow.com/a/1646913/126995
  12.             size_t res = k.first * (1 << 16 + 3) + k.second + 5;
  13.             return res;
  14.         }
  15.     };
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement