2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-07-03 12:35:51 +00:00

hecl/hecl: Make hash constructors explicit where applicable

This commit is contained in:
Lioncash 2019-08-15 03:06:26 -04:00
parent 06548409f8
commit 9ec19d99cd

View File

@ -413,9 +413,9 @@ public:
constexpr Hash(const Hash&) = default;
constexpr Hash(Hash&&) noexcept = default;
constexpr Hash(uint64_t hashin) : hash(hashin) {}
Hash(const void* buf, size_t len) : hash(XXH64((uint8_t*)buf, len, 0)) {}
Hash(std::string_view str) : hash(XXH64((uint8_t*)str.data(), str.size(), 0)) {}
Hash(std::wstring_view str) : hash(XXH64((uint8_t*)str.data(), str.size() * 2, 0)) {}
explicit Hash(const void* buf, size_t len) : hash(XXH64((uint8_t*)buf, len, 0)) {}
explicit Hash(std::string_view str) : hash(XXH64((uint8_t*)str.data(), str.size(), 0)) {}
explicit Hash(std::wstring_view str) : hash(XXH64((uint8_t*)str.data(), str.size() * 2, 0)) {}
constexpr uint32_t val32() const { return uint32_t(hash) ^ uint32_t(hash >> 32); }
constexpr uint64_t val64() const { return uint64_t(hash); }