Compilers and argument order of evaluation in C++

前端 未结 6 617
一整个雨季
一整个雨季 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:15

    I found answer in c++ standards.

    Paragraph 5.2.2.8:

    The order of evaluation of arguments is unspecified. All side effects of argument expression evaluations take effect before the function is entered. The order of evaluation of the postfix expression and the argument expression list is unspecified.

    In other words, It depends on compiler only.

提交回复
热议问题