Index: base/version.cc |
diff --git a/base/version.cc b/base/version.cc |
index fe224eb8662ffb8ff8575c35f4e5adbd68dc9bc0..6ad0cbe10971c6c1994e1e146548205adb8b8710 100644 |
--- a/base/version.cc |
+++ b/base/version.cc |
@@ -4,6 +4,8 @@ |
#include "base/version.h" |
+#include <algorithm> |
+ |
#include "base/logging.h" |
#include "base/string_number_conversions.h" |
#include "base/string_split.h" |
@@ -32,6 +34,14 @@ Version::Version() : is_valid_(false) {} |
Version::~Version() {} |
+Version* Version::Clone() const { |
+ DCHECK(is_valid_); |
+ Version* copy = new Version(); |
+ copy->components_ = components_; |
+ copy->is_valid_ = true; |
+ return copy; |
+} |
+ |
bool Version::Equals(const Version& that) const { |
DCHECK(is_valid_); |
DCHECK(that.is_valid_); |