aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/include
diff options
context:
space:
mode:
authorAlexander Karatarakis <alkarata@microsoft.com>2016-10-03 17:20:52 -0700
committerAlexander Karatarakis <alkarata@microsoft.com>2016-10-03 17:20:52 -0700
commit330b411cd2f4aa25632b2ae5ea2fef396fb13d12 (patch)
treec7aa03d21ebb2ad58241f3f412fd13bdb34d8397 /toolsrc/include
parente03e617f069471c34e90b1a84e256c1607252f04 (diff)
downloadvcpkg-330b411cd2f4aa25632b2ae5ea2fef396fb13d12.tar.gz
vcpkg-330b411cd2f4aa25632b2ae5ea2fef396fb13d12.zip
[triplet] Force using the factory that does sanity checks
Diffstat (limited to 'toolsrc/include')
-rw-r--r--toolsrc/include/triplet.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/toolsrc/include/triplet.h b/toolsrc/include/triplet.h
index f9d1e9483..32ea2e711 100644
--- a/toolsrc/include/triplet.h
+++ b/toolsrc/include/triplet.h
@@ -6,17 +6,22 @@ namespace vcpkg
{
struct triplet
{
+ static triplet from_canonical_name(const std::string& triplet_as_string);
+
static const triplet X86_WINDOWS;
static const triplet X64_WINDOWS;
static const triplet X86_UWP;
static const triplet X64_UWP;
static const triplet ARM_UWP;
- std::string value;
+ const std::string& canonical_name() const;
std::string architecture() const;
std::string system() const;
+
+ private:
+ std::string m_canonical_name;
};
bool operator==(const triplet& left, const triplet& right);
@@ -39,7 +44,7 @@ namespace std
{
std::hash<std::string> hasher;
size_t hash = 17;
- hash = hash * 31 + hasher(t.value);
+ hash = hash * 31 + hasher(t.canonical_name());
return hash;
}
};