int foo(int a, int& b, int c) {
int temp = a;
a = b;
b = c;
c = temp;
return a - b;
}
int main() {
**foo(foo(a, b, c), b, foo(a, b, foo(a, b, c)));**
return 0;
}
哪个foo函数调用首先被评估,为什么? 我发布的代码被简化了,所以不需要追踪它。 谢谢评估这个的顺序是什么?为什么? C++
UB,参数'B'被修改不止一次 - :[注注完这样 初始化都不定相对于每个其他 测序。 –