diff options
| author | Alexander Karatarakis <alkarata@microsoft.com> | 2017-04-27 17:56:06 -0700 |
|---|---|---|
| committer | Alexander Karatarakis <alkarata@microsoft.com> | 2017-04-27 18:59:57 -0700 |
| commit | 75e8752cb90eb8bc7717518d9d6a5c68f27f2b0f (patch) | |
| tree | b3a8c01beebba2b7e5524363b59bfc088aab83a2 /toolsrc/include/PackageSpec.h | |
| parent | db2bc7ed80cd85935bcf80a02a06c796d01197b7 (diff) | |
| download | vcpkg-75e8752cb90eb8bc7717518d9d6a5c68f27f2b0f.tar.gz vcpkg-75e8752cb90eb8bc7717518d9d6a5c68f27f2b0f.zip | |
Run clang-format over the headers. Remove stray Version.h/cpp. Fix location of VersionT.cpp
Diffstat (limited to 'toolsrc/include/PackageSpec.h')
| -rw-r--r-- | toolsrc/include/PackageSpec.h | 38 |
1 files changed, 16 insertions, 22 deletions
diff --git a/toolsrc/include/PackageSpec.h b/toolsrc/include/PackageSpec.h index 0d69ac89c..8f1d8cfc5 100644 --- a/toolsrc/include/PackageSpec.h +++ b/toolsrc/include/PackageSpec.h @@ -26,28 +26,22 @@ namespace vcpkg bool operator==(const PackageSpec& left, const PackageSpec& right); bool operator!=(const PackageSpec& left, const PackageSpec& right); -} //namespace vcpkg +} -namespace std +template<> +struct std::hash<vcpkg::PackageSpec> { - template <> - struct hash<vcpkg::PackageSpec> + size_t operator()(const vcpkg::PackageSpec& value) const { - size_t operator()(const vcpkg::PackageSpec& value) const - { - size_t hash = 17; - hash = hash * 31 + std::hash<std::string>()(value.name()); - hash = hash * 31 + std::hash<vcpkg::Triplet>()(value.triplet()); - return hash; - } - }; - - template <> - struct equal_to<vcpkg::PackageSpec> - { - bool operator()(const vcpkg::PackageSpec& left, const vcpkg::PackageSpec& right) const - { - return left == right; - } - }; -} // namespace std + size_t hash = 17; + hash = hash * 31 + std::hash<std::string>()(value.name()); + hash = hash * 31 + std::hash<vcpkg::Triplet>()(value.triplet()); + return hash; + } +}; + +template<> +struct std::equal_to<vcpkg::PackageSpec> +{ + bool operator()(const vcpkg::PackageSpec& left, const vcpkg::PackageSpec& right) const { return left == right; } +}; |
