mirror of
https://github.com/Neargye/magic_enum.git
synced 2026-01-08 23:24:20 +00:00
fix enum_fuse shift value calculation (Neargye#386) (#387)
This commit is contained in:
parent
c2636e59da
commit
15a085f234
1 changed files with 1 additions and 1 deletions
|
|
@ -42,7 +42,7 @@ template <typename E>
|
|||
constexpr optional<std::uintmax_t> fuse_one_enum(optional<std::uintmax_t> hash, E value) noexcept {
|
||||
if (hash) {
|
||||
if (const auto index = enum_index(value)) {
|
||||
return (*hash << log2(enum_count<E>() + 1)) | *index;
|
||||
return (*hash << log2((enum_count<E>() << 1) - 1)) | *index;
|
||||
}
|
||||
}
|
||||
return {};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue