Index: tools/gn/source_dir.h |
diff --git a/tools/gn/source_dir.h b/tools/gn/source_dir.h |
index 4aa344a122ddce7efd813eceea7fae7e1f2b9e90..380201e23aabb24c69e7c5fb7680471319c6b249 100644 |
--- a/tools/gn/source_dir.h |
+++ b/tools/gn/source_dir.h |
@@ -5,6 +5,7 @@ |
#ifndef TOOLS_GN_SOURCE_DIR_H_ |
#define TOOLS_GN_SOURCE_DIR_H_ |
+#include <algorithm> |
#include <string> |
#include "base/containers/hash_tables.h" |
@@ -85,6 +86,10 @@ class SourceDir { |
return value_ < other.value_; |
} |
+ void swap(SourceDir& other) { |
+ std::swap(value_, other.value_); |
+ } |
+ |
private: |
friend class SourceFile; |
std::string value_; |
@@ -109,4 +114,12 @@ inline size_t hash_value(const SourceDir& v) { |
} // namespace BASE_HASH_NAMESPACE |
+namespace std { |
+ |
+template<> inline void swap(SourceDir& lhs, SourceDir& rhs) { |
+ lhs.swap(rhs); |
+} |
+ |
+} // namespace std |
+ |
#endif // TOOLS_GN_SOURCE_DIR_H_ |