3 ms·
IIRC for a brief period GCC considered values outside of the enumeration as UB and heavily optimized according to this. At some point this interpretetion made i
by gpderetta 2y ago
IIRC for a brief period GCC considered values outside of the enumeration as UB and heavily optimized according to this. At some point this interpretetion made it as far as at least a draft standard. Then it got reverted as it went against decades of common usages and instead the opposite was made explicit in the standard.
Making it UB for enum classes was considered, but the strongly typeded alias use case was considered safer and more useful.
- account42 2y agoUnfortunate. Then again, constraint value integer types are something that would be useful in general and perhaps can be provided independently of enum class.