4 ms·
/permissive or not, ternary operators have some bugs in all compilers. My favorite MSVC one: https://developercommunity.visualstudio.com/t/wrong-type-of-ternar
by planede 4y ago
/permissive or not, ternary operators have some bugs in all compilers. My favorite MSVC one:
https://developercommunity.visualstudio.com/t/wrong-type-of-ternary-operator-true--/1698058 https://developercommunity.visualstudio.com/t/wrong-type-of-...
- edwinbalani 4y agoYup, right on. We found a bug that crops up when a certain compiler (proprietary, not MSVC) tries to reuse the result of a float comparison originally made in a ternary expression. The compiler ends up omitting most of the rest of the function's assembly, which breaks things as much as you'd expect. (For bonus fun, our ternary expression was deep under about four layers of macro.)
- phaedrus 4y agoI like to tell the story of one time I tried the ternary expression, "return (cond)? result : throw;" and it crashed the compiler. (It was an older version of MSVC.)