1
0
Fork 0
mirror of https://github.com/Neargye/magic_enum.git synced 2026-01-11 23:54:19 +00:00
magic_enum/test
Alexander Karatarakis 0f36cd5b0f Introduce mixed_sign_less()/min()/max() (#18)
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().
2019-10-14 10:44:09 +03:00
..
3rdparty/Catch2 update Catch2 2019-04-30 10:19:49 +05:00
CMakeLists.txt update cmake 2019-08-24 13:10:55 +05:00
test.cpp Introduce mixed_sign_less()/min()/max() (#18) 2019-10-14 10:44:09 +03:00