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_CONTAINERS_HASH_TABLES_H_ | 21 #ifndef BASE_CONTAINERS_HASH_TABLES_H_ |
22 #define BASE_CONTAINERS_HASH_TABLES_H_ | 22 #define BASE_CONTAINERS_HASH_TABLES_H_ |
23 | 23 |
24 #include "base/string16.h" | 24 #include "base/strings/string16.h" |
25 #include "build/build_config.h" | 25 #include "build/build_config.h" |
26 | 26 |
27 #if defined(COMPILER_MSVC) | 27 #if defined(COMPILER_MSVC) |
28 #include <hash_map> | 28 #include <hash_map> |
29 #include <hash_set> | 29 #include <hash_set> |
30 | 30 |
31 #define BASE_HASH_NAMESPACE stdext | 31 #define BASE_HASH_NAMESPACE stdext |
32 | 32 |
33 #elif defined(COMPILER_GCC) | 33 #elif defined(COMPILER_GCC) |
34 #if defined(OS_ANDROID) | 34 #if defined(OS_ANDROID) |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 #endif // COMPILER | 111 #endif // COMPILER |
112 | 112 |
113 namespace base { | 113 namespace base { |
114 using BASE_HASH_NAMESPACE::hash_map; | 114 using BASE_HASH_NAMESPACE::hash_map; |
115 using BASE_HASH_NAMESPACE::hash_multimap; | 115 using BASE_HASH_NAMESPACE::hash_multimap; |
116 using BASE_HASH_NAMESPACE::hash_multiset; | 116 using BASE_HASH_NAMESPACE::hash_multiset; |
117 using BASE_HASH_NAMESPACE::hash_set; | 117 using BASE_HASH_NAMESPACE::hash_set; |
118 } | 118 } |
119 | 119 |
120 #endif // BASE_CONTAINERS_HASH_TABLES_H_ | 120 #endif // BASE_CONTAINERS_HASH_TABLES_H_ |
OLD | NEW |