| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 // | 4 // |
| 5 | 5 |
| 6 // | 6 // |
| 7 // Deal with the differences between Microsoft and GNU implemenations | 7 // Deal with the differences between Microsoft and GNU implemenations |
| 8 // of hash_map. Allows all platforms to use |base::hash_map| and | 8 // of hash_map. Allows all platforms to use |base::hash_map| and |
| 9 // |base::hash_set|. | 9 // |base::hash_set|. |
| 10 // eg: | 10 // eg: |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 // Implement methods for hashing a pair of integers, so they can be used as | 313 // Implement methods for hashing a pair of integers, so they can be used as |
| 314 // keys in STL containers. | 314 // keys in STL containers. |
| 315 | 315 |
| 316 template<typename Type1, typename Type2> | 316 template<typename Type1, typename Type2> |
| 317 struct hash<std::pair<Type1, Type2> > { | 317 struct hash<std::pair<Type1, Type2> > { |
| 318 std::size_t operator()(std::pair<Type1, Type2> value) const { | 318 std::size_t operator()(std::pair<Type1, Type2> value) const { |
| 319 return base::HashPair(value.first, value.second); | 319 return base::HashPair(value.first, value.second); |
| 320 } | 320 } |
| 321 }; | 321 }; |
| 322 | 322 |
| 323 } | 323 } // namespace BASE_HASH_NAMESPACE |
| 324 | 324 |
| 325 #undef DEFINE_PAIR_HASH_FUNCTION_START | 325 #undef DEFINE_PAIR_HASH_FUNCTION_START |
| 326 #undef DEFINE_PAIR_HASH_FUNCTION_END | 326 #undef DEFINE_PAIR_HASH_FUNCTION_END |
| 327 | 327 |
| 328 #endif // BASE_CONTAINERS_HASH_TABLES_H_ | 328 #endif // BASE_CONTAINERS_HASH_TABLES_H_ |
| OLD | NEW |