3 ms·
datatype99 generates a switch expression under the hood, and modern compilers check this switch expression for exhaustiveness.
by Hirrolot 6y ago
datatype99 generates a switch expression under the hood, and modern compilers check this switch expression for exhaustiveness.
- DaiPlusPlus 6y agoHow do compilers check for exhaustiveness when the domain is unbound? Or rather: how does one constrain an integer in C? C enums are glorified consts, it’s still legal to do `myenum_t x = 0xFFFF` where 0xFFFF is not a defined value. This is necessary to allow for flags/bitfield enums.