On Sun, Oct 24, 2004 at 01:42:02PM -0500, Adam Majer wrote: > You can rearrange -X+Y, as well as -X()+Y or -X+Y(), but you cannot do > this for -X()+Y() unless you can guarantee that X() doesn't depend on > Y() and vice-versa.
Could you quote standard chapter and verse for this? I believe you are incorrect. While the function calls are sequence points, they are not defined to happen in any particular order. >From ISO C 6.5#3: [#3] The grouping of operators and operands is indicated by the syntax. Except as specified later (for the function- call (), &&, ||, ?:, and comma operators), the order of evaluation of subexpressions and the order in which side effects take place are both unspecified. I don't have ISO C++ handy but I believe it is worded similarly. -- Daniel Jacobowitz