post-递减和逻辑运算符之间的交互

Interaction between post-decrement and logical operators

例如,在下面的表达式中

i-- && expr

计算expri是否已经递减?语言律师会适应这里。

如果 && 运算符是内置运算符,则可以。来自 [expr.log.and]/2:

If the second expression is evaluated, every value computation and side effect associated with the first expression is sequenced before every value computation and side effect associated with the second expression.

如果运算符重载,则为普通函数调用,函数调用参数的求值顺序未指定。