gpt4 book ai didi

c++ - 后递减运算符和逻辑运算符之间的交互

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:35:14 28 4
gpt4 key购买 nike

例如,在下面的表达式中

i-- && 表达式

i 在计算 expr 时是否已经递减?语言律师会适应这里。

最佳答案

如果 && 运算符是内置运算符,则可以。来自 [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.

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

关于c++ - 后递减运算符和逻辑运算符之间的交互,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35978601/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com