Re:Is C/C++ worth it?
by repsilat on Monday July 23, 2012 @09:37PM
(#4283889)
Evaluation order is implementation-defined. I'm pretty sure all of the arguments are evaluated before any printing is done at all. The code
is equivalent to
, which is equivalent to
`b()` can certainly be evaluated before the first `operator<<` is evaluated. Hell, `b()` can be evaluated before "asdf;" is evaluated. Consider the following code:
This prints "0 1" in Clang (at all levels of optimisation), and it prints out "1 0" in gcc (again, at all levels of optimisation). If they're differing on something as simple as this it's clearly allowable by the standard.
[ Parent
| on HN ]
There are no comments on this comment yet.