aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoratkawa7 <atkawa7@yahoo.com>2018-01-27 00:44:07 +0200
committerAlexander Karatarakis <alex@karatarakis.com>2018-01-26 14:44:07 -0800
commit75f19a58ba27f79da4c57d22e4a9e92afcb55d4c (patch)
tree025861ac22693fb42b20eb3ca31088ef97ed4405
parent884afaa9ce1b3fb578a337acbeb0a4ba174cd133 (diff)
downloadvcpkg-75f19a58ba27f79da4c57d22e4a9e92afcb55d4c.tar.gz
vcpkg-75f19a58ba27f79da4c57d22e4a9e92afcb55d4c.zip
[vcpkg] Add string constructor (#2429)
* [vcpkg] Add string constructor * Update versiont.h
-rw-r--r--toolsrc/include/vcpkg/versiont.h1
-rw-r--r--toolsrc/src/vcpkg/versiont.cpp1
2 files changed, 2 insertions, 0 deletions
diff --git a/toolsrc/include/vcpkg/versiont.h b/toolsrc/include/vcpkg/versiont.h
index 6d8332521..8427dfe3b 100644
--- a/toolsrc/include/vcpkg/versiont.h
+++ b/toolsrc/include/vcpkg/versiont.h
@@ -6,6 +6,7 @@ namespace vcpkg
struct VersionT
{
VersionT();
+ VersionT(std::string&& value);
VersionT(const std::string& value);
const std::string& to_string() const;
diff --git a/toolsrc/src/vcpkg/versiont.cpp b/toolsrc/src/vcpkg/versiont.cpp
index 91f7e23ef..0d4a39255 100644
--- a/toolsrc/src/vcpkg/versiont.cpp
+++ b/toolsrc/src/vcpkg/versiont.cpp
@@ -6,6 +6,7 @@
namespace vcpkg
{
VersionT::VersionT() : value("0.0.0") {}
+ VersionT::VersionT(std::string&& value) : value(std::move(value)) {}
VersionT::VersionT(const std::string& value) : value(value) {}
const std::string& VersionT::to_string() const { return value; }
bool operator==(const VersionT& left, const VersionT& right) { return left.to_string() == right.to_string(); }