How to Replace an Else-if Sequence With an Elegant Ternary Operator
▻https://www.fluentcpp.com/2018/02/27/replace-else-if-ternary-operator
One of the comments left on the Reddit thread of How to make if statements more understandable by /u/loup-vaillant, showed a suggestion to represent an else-if logic a different way, by using the ternary operator (?:) in a certain way. That suggestion instrigued me, and I’d like to share it with you today. And while you’re here, […]