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

Unified Diff: tools/gn/source_file.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/source_dir.h ('k') | tools/gn/target.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/source_file.h
diff --git a/tools/gn/source_file.h b/tools/gn/source_file.h
index 83ce2b59d50bc182e205e1d0bac9fd5d9ed38c5e..3b657beb7ea1a7c6d4816648f2ad53f97adc750b 100644
--- a/tools/gn/source_file.h
+++ b/tools/gn/source_file.h
@@ -5,6 +5,7 @@
#ifndef TOOLS_GN_SOURCE_FILE_H_
#define TOOLS_GN_SOURCE_FILE_H_
+#include <algorithm>
#include <string>
#include "base/containers/hash_tables.h"
@@ -69,6 +70,10 @@ class SourceFile {
return value_ < other.value_;
}
+ void swap(SourceFile& other) {
+ value_.swap(other.value_);
+ }
+
private:
friend class SourceDir;
@@ -94,4 +99,8 @@ inline size_t hash_value(const SourceFile& v) {
} // namespace BASE_HASH_NAMESPACE
+inline void swap(SourceFile& lhs, SourceFile& rhs) {
+ lhs.swap(rhs);
+}
+
#endif // TOOLS_GN_SOURCE_FILE_H_
« no previous file with comments | « tools/gn/source_dir.h ('k') | tools/gn/target.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698