1
0
Fork 0
mirror of https://github.com/Neargye/magic_enum.git synced 2026-01-10 23:44:29 +00:00
magic_enum/include
Alexander Karatarakis db4c55c36a Change the way range_min()/max() is calculated (#19)
This was previously done via parameter expansion. The expanded form
looks like this:
A(128) && A(127) && ... && A(X) && ... && A(0)

where A(X) is the actual range_max which is crafted to return 'false'.
Static analysis detects that expressions after A(X) are
dead code due to short-circuiting.

The new implementation uses a simple loop to find the extrema,
similarly to the loop in detail::values().
Furthermore, it uses only one parameter expansion (for reflected_set_v),
as opposed to two (one for range_min and one for range_max).
2019-10-14 10:44:42 +03:00
..
magic_enum.hpp Change the way range_min()/max() is calculated (#19) 2019-10-14 10:44:42 +03:00