Does it make sense for unary operators to be associative?

后端 未结 4 2170
小鲜肉
小鲜肉 2020-12-06 10:45

The C++ operator precedence table from http://en.cppreference.com/w/cpp/language/operator_precedence (I know it\'s not normative, but the standard doesn\'t talk about preced

4条回答
  •  醉酒成梦
    2020-12-06 11:03

    Not sure, but if the following were valid, yes.

    ++i--
    

    but as it isn't, and throws the error

    lvalue required as increment operand
    

    All behaviour of the unary operator can be explained in terms of precedence only.

提交回复
热议问题