3 ms·
> I get that this was just an example, but a boolean 5 would actually be language-level UB that could have very real correctness implications! Yes, that's why
by Dylan16807 5y ago
> I get that this was just an example, but a boolean 5 would actually be language-level UB that could have very real correctness implications!
Yes, that's why I used it as the example.
And you don't need anything that complicated, either. A simple if or switch statement might be optimized by the compiler for 0 and 1 and jump into random code for 5.