Compilers and argument order of evaluation in C++

前端 未结 6 618
一整个雨季
一整个雨季 2020-11-22 10:33

Okay, I\'m aware that the standard dictates that a C++ implementation may choose in which order arguments of a function are evaluated, but are there any implementations that

6条回答
  •  再見小時候
    2020-11-22 11:24

    I expect that most modern compilers would attempt to interleave the instructions computing the arguments, given that they are required by the C++ standard to be independent and thus lack any interdependencies. Doing this should help to keep a deeply-pipelined CPU's execution units full and thereby increase throughput. (At least I would expect that a compiler that claims to be an optimising compiler would do so when optimisation flags are given.)

提交回复
热议问题