mirror of
https://github.com/Neargye/magic_enum.git
synced 2026-01-10 23:44:29 +00:00
Previously, there was mixed sign comparison: ``` reflected_min_v = -120 > 0U ? -120 : 0 ``` which returns -120 because the condition is true, since the compiler casts the signed value to unsigned, leading to a huge value. This caused the following values as result: ``` reflected_min_v == -120 min_v = -1 static_cast<U>(min_v) = 18446744073709551615 ``` The last one is used in magic_enum::enum_index(). |
||
|---|---|---|
| .. | ||
| magic_enum.hpp | ||