3 ms·
I was not thinking about local state; you're right that the sequence points ensure an orderly evaluation there. My point was that since ternaries can call func
by microtherion 6y ago
I was not thinking about local state; you're right that the sequence points ensure an orderly evaluation there.
My point was that since ternaries can call functions, and functions can have side effects on global state, the concept of an "if" being a "statement" vs a ternary being an "expression / value" is not nearly as meaningful as it's made out to be. A ternary can trade stocks, fire a 500W laser, unlock a velociraptor enclosure, etc, just as easily as an if can.