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

Unified Diff: base/version.cc

Issue 2163033002: base::Version constructor from std::vector<uint32_t> (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: operator= and changes based on comments Created 4 years, 5 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
Index: base/version.cc
diff --git a/base/version.cc b/base/version.cc
index 02213fbf158ed56179dacf3288ab0f58bcf95c0b..31a40daa6d4ecdba54c3ea66d142b1ae2d93b256 100644
--- a/base/version.cc
+++ b/base/version.cc
@@ -93,6 +93,19 @@ Version::Version(const std::string& version_str) {
components_.swap(parsed);
}
+Version::Version(std::vector<uint32_t>&& components)
+ : components_(components) {}
+
+Version& Version::operator=(Version&& other) {
danakj 2016/07/19 20:50:07 can you just use = default?
Alex Z. 2016/07/22 13:28:03 Done.
+ components_ = std::move(other.components_);
+ return *this;
+}
+
+Version& Version::operator=(const Version& other) {
danakj 2016/07/19 20:50:07 ditto, =default?
Alex Z. 2016/07/22 13:28:03 Done.
+ components_ = other.components_;
+ return *this;
+}
+
bool Version::IsValid() const {
return (!components_.empty());
}
« base/version.h ('K') | « base/version.h ('k') | base/version_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698