| 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: |
| 11 // base::hash_map<int> my_map; | 11 // base::hash_map<int> my_map; |
| 12 // base::hash_set<int> my_set; | 12 // base::hash_set<int> my_set; |
| 13 // | 13 // |
| 14 // NOTE: It is an explicit non-goal of this class to provide a generic hash | 14 // NOTE: It is an explicit non-goal of this class to provide a generic hash |
| 15 // function for pointers. If you want to hash a pointers to a particular class, | 15 // function for pointers. If you want to hash a pointers to a particular class, |
| 16 // please define the template specialization elsewhere (for example, in its | 16 // please define the template specialization elsewhere (for example, in its |
| 17 // header file) and keep it specific to just pointers to that class. This is | 17 // header file) and keep it specific to just pointers to that class. This is |
| 18 // because identity hashes are not desirable for all types that might show up | 18 // because identity hashes are not desirable for all types that might show up |
| 19 // in containers as pointers. | 19 // in containers as pointers. |
| 20 | 20 |
| 21 #ifndef BASE_HASH_TABLES_H_ | 21 #ifndef BASE_HASH_TABLES_H_ |
| 22 #define BASE_HASH_TABLES_H_ | 22 #define BASE_HASH_TABLES_H_ |
| 23 #pragma once | |
| 24 | 23 |
| 25 #include "build/build_config.h" | 24 #include "build/build_config.h" |
| 26 | 25 |
| 27 #include "base/string16.h" | 26 #include "base/string16.h" |
| 28 | 27 |
| 29 #if defined(COMPILER_MSVC) | 28 #if defined(COMPILER_MSVC) |
| 30 #include <hash_map> | 29 #include <hash_map> |
| 31 #include <hash_set> | 30 #include <hash_set> |
| 32 | 31 |
| 33 #define BASE_HASH_NAMESPACE stdext | 32 #define BASE_HASH_NAMESPACE stdext |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 #else // COMPILER | 110 #else // COMPILER |
| 112 #error define BASE_HASH_NAMESPACE for your compiler | 111 #error define BASE_HASH_NAMESPACE for your compiler |
| 113 #endif // COMPILER | 112 #endif // COMPILER |
| 114 | 113 |
| 115 namespace base { | 114 namespace base { |
| 116 using BASE_HASH_NAMESPACE::hash_map; | 115 using BASE_HASH_NAMESPACE::hash_map; |
| 117 using BASE_HASH_NAMESPACE::hash_set; | 116 using BASE_HASH_NAMESPACE::hash_set; |
| 118 } | 117 } |
| 119 | 118 |
| 120 #endif // BASE_HASH_TABLES_H_ | 119 #endif // BASE_HASH_TABLES_H_ |
| OLD | NEW |