1
0
Fork 0
mirror of https://github.com/Neargye/magic_enum.git synced 2026-01-09 23:34:23 +00:00

Fix compilation error, when including magic_enum after windows.h (#189)

This commit is contained in:
Bård Sigurd Møller 2022-05-28 20:55:51 +02:00 committed by GitHub
parent 87190b811c
commit 6956c56033
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -739,7 +739,7 @@ struct constexpr_hash_t<Value, std::enable_if_t<std::is_same_v<Value, string_vie
constexpr std::uint32_t operator()(string_view value) const noexcept {
auto acc = static_cast<std::uint64_t>(2166136261ULL);
for (const auto c : value) {
acc = ((acc ^ static_cast<std::uint64_t>(c)) * static_cast<std::uint64_t>(16777619ULL)) & std::numeric_limits<std::uint32_t>::max();
acc = ((acc ^ static_cast<std::uint64_t>(c)) * static_cast<std::uint64_t>(16777619ULL)) & (std::numeric_limits<std::uint32_t>::max)();
}
return static_cast<std::uint32_t>(acc);
}