Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(92)

Side by Side Diff: tools/gn/source_dir.h

Issue 612323010: Align base::hash_map with C++11. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Try a different tack for C++ insanity Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 #ifndef TOOLS_GN_SOURCE_DIR_H_ 5 #ifndef TOOLS_GN_SOURCE_DIR_H_
6 #define TOOLS_GN_SOURCE_DIR_H_ 6 #define TOOLS_GN_SOURCE_DIR_H_
7 7
8 #include <algorithm> 8 #include <algorithm>
9 #include <string> 9 #include <string>
10 10
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 97
98 private: 98 private:
99 friend class SourceFile; 99 friend class SourceFile;
100 std::string value_; 100 std::string value_;
101 101
102 // Copy & assign supported. 102 // Copy & assign supported.
103 }; 103 };
104 104
105 namespace BASE_HASH_NAMESPACE { 105 namespace BASE_HASH_NAMESPACE {
106 106
107 #if defined(COMPILER_GCC)
108 template<> struct hash<SourceDir> { 107 template<> struct hash<SourceDir> {
109 std::size_t operator()(const SourceDir& v) const { 108 std::size_t operator()(const SourceDir& v) const {
110 hash<std::string> h; 109 hash<std::string> h;
111 return h(v.value()); 110 return h(v.value());
112 } 111 }
113 }; 112 };
114 #elif defined(COMPILER_MSVC)
115 inline size_t hash_value(const SourceDir& v) {
116 return hash_value(v.value());
117 }
118 #endif // COMPILER...
119 113
120 } // namespace BASE_HASH_NAMESPACE 114 } // namespace BASE_HASH_NAMESPACE
121 115
122 inline void swap(SourceDir& lhs, SourceDir& rhs) { 116 inline void swap(SourceDir& lhs, SourceDir& rhs) {
123 lhs.swap(rhs); 117 lhs.swap(rhs);
124 } 118 }
125 119
126 #endif // TOOLS_GN_SOURCE_DIR_H_ 120 #endif // TOOLS_GN_SOURCE_DIR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698