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
1 changed files with 3 additions and 3 deletions

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