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

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: comments Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/gn/gn.gyp ('k') | tools/gn/source_dir.h » ('j') | tools/gn/uniquify.h » ('J')
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 0c5d35d6804e5df32fbdcbf86bb400eeef2407bb..1cb8a9bcc17ad00da8506a476d789f194f2385ba 100644
--- a/tools/gn/label.h
+++ b/tools/gn/label.h
@@ -78,6 +78,13 @@ class Label {
return toolchain_name_ < other.toolchain_name_;
}
+ void swap(Label& other) {
+ std::swap(dir_, other.dir_);
+ std::swap(name_, other.name_);
+ std::swap(toolchain_dir_, other.toolchain_dir_);
+ std::swap(toolchain_name_, other.toolchain_name_);
+ }
+
// Returns true if the toolchain dir/name of this object matches some
// other object.
bool ToolchainsEqual(const Label& other) const {
@@ -116,4 +123,12 @@ inline size_t hash_value(const Label& v) {
} // namespace BASE_HASH_NAMESPACE
+namespace std {
+
+template<> inline void swap(Label& lhs, Label& rhs) {
+ lhs.swap(rhs);
+}
+
+} // namespace std
+
#endif // TOOLS_GN_LABEL_H_
« no previous file with comments | « tools/gn/gn.gyp ('k') | tools/gn/source_dir.h » ('j') | tools/gn/uniquify.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698