9 thoughts on “C++ has a LHS ternary operator.

  1. The trick is that C++’s system of abstraction allows expressions to work on both RHS and LHS values without grammatic differentiation, and assignment just handles LHS values as implicit pointers once they’re calculated. It’s not a special syntax.

    Like

  2. Ok I meant an LHS expression needs to resolve to a location.

    a || b doesn’t do that unambiguously. It could mean if a is not false then use a else use b or it could mean use the value which is the boolean OR of the value of a and the value of b

    Like

Leave a comment