3 ms·
Why though? Ternary is always introduced as syntactic sugar for if/else.
by IshKebab 4y ago
Why though? Ternary is always introduced as syntactic sugar for if/else.
- zasdffaa 4y agoMy K&R C book agrees with you, but there when you know about cmov, it seems to map cleanly to ?:. It's just my opinion and what I feel. I can't back it up any better.
- monocasa 4y agoBecause it's an single assignment expression dependent on a result that'll probably trivially be in a status flag.