From 330b411cd2f4aa25632b2ae5ea2fef396fb13d12 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 3 Oct 2016 17:20:52 -0700 Subject: [triplet] Force using the factory that does sanity checks --- toolsrc/include/triplet.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'toolsrc/include') 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 hasher; size_t hash = 17; - hash = hash * 31 + hasher(t.value); + hash = hash * 31 + hasher(t.canonical_name()); return hash; } }; -- cgit v1.2.3