C++ expressions do not define an order of evaluation for the operands. This is for the sake of potential optimizations.
for the very simple case :
int i = f() + g();
Does such optimizations include evaluating f() and g() on different cores ? and if such optimizations are possible, does it mean that the order of evaluation is runtime dependent ?
Does such optimizations include evaluating f() and g() on different cores?
Yes, even if I doubt it was the case in practice:
More probable optimization is with inlining and reordering instruction (some value can already be in register, in cache, ...).
and if such optimizations are possible, does it mean that the order of evaluation is runtime dependent?
We can read in evaluation_order
Order of evaluation of any part of any expression, including order of evaluation of function arguments is unspecified (with some exceptions listed below). The compiler can evaluate operands and other subexpressions in any order, and may choose another order when the same expression is evaluated again.
Order of evaluation might change at any evaluation, so might depend of runtime.