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

Unified Diff: tools/gn/label.h

Issue 26537002: Add a UniqueVector class to GN (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: REview comments, remove npos Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/gn/header_checker.cc ('k') | tools/gn/label_ptr.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_
« no previous file with comments | « tools/gn/header_checker.cc ('k') | tools/gn/label_ptr.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698