Index: tools/gn/label.h |
diff --git a/tools/gn/label.h b/tools/gn/label.h |
index 2b7ef4e9a5cadb77118406fda4267ce035caa782..1028b3088c85f2c38141d173a17f9e62b2301684 100644 |
--- a/tools/gn/label.h |
+++ b/tools/gn/label.h |
@@ -83,6 +83,13 @@ class Label { |
return toolchain_name_ < other.toolchain_name_; |
} |
+ void swap(Label& other) { |
+ dir_.swap(other.dir_); |
+ name_.swap(other.name_); |
+ toolchain_dir_.swap(other.toolchain_dir_); |
+ toolchain_name_.swap(other.toolchain_name_); |
+ } |
+ |
// Returns true if the toolchain dir/name of this object matches some |
// other object. |
bool ToolchainsEqual(const Label& other) const { |
@@ -121,4 +128,8 @@ inline size_t hash_value(const Label& v) { |
} // namespace BASE_HASH_NAMESPACE |
+inline void swap(Label& lhs, Label& rhs) { |
+ lhs.swap(rhs); |
+} |
+ |
#endif // TOOLS_GN_LABEL_H_ |