Re:Three new utility functions in C++23
by flohofwoe on Wednesday November 09, 2022 @08:41AM
(#33531435)
It's been useful to me in one very specific place so far: to remove a range-check in front of the jump-table lookup in a switch-case statement. For 'very hot' code paths like in the instruction decoder of an emulator or interpreting byte-code VM this might actually translate to a measurable difference.
In debug mode it makes a lot of sense to replace the __builtin_unreachable with an abort() though.
In debug mode it makes a lot of sense to replace the __builtin_unreachable with an abort() though.