[vcpkg] Add string constructor (#2429)

* [vcpkg] Add string constructor

* Update versiont.h
This commit is contained in:
atkawa7 2018-01-27 00:44:07 +02:00 committed by Alexander Karatarakis
parent 884afaa9ce
commit 75f19a58ba
2 changed files with 2 additions and 0 deletions

View File

@ -6,6 +6,7 @@ namespace vcpkg
struct VersionT
{
VersionT();
VersionT(std::string&& value);
VersionT(const std::string& value);
const std::string& to_string() const;

View File

@ -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(); }