Order of evaluation in chain invocation in C++

隐身守侯 提交于 2019-12-05 05:14:37

The gist of it is that in a function call, X(Y, Z) ; evaluation of all of X, Y, Z are indeterminately sequenced with respect to each other. The only sequencing is that Y and Z are sequenced-before the call to the function which X evaluated to.

Suppose we have:

typedef void (*fptr)(int, double);
fptr a();
int b();
double c();

a()(b(), c());

The three functions a, b, c may be called in any order. Of course this all applies recursively to any sub-expressions.

No, func3 and func4 may be evaluated in either order (but not interleaved).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!