It's not defined as "immediately after". That's the problem; it's not _precisely_ defined. If x=1, what's y=x++ + x++? 1+2, if immediately after. But VS2005 if presented with
Code:
int x=1;
int y=x++ + x++;
printf("%d %d %d\n",y,x++,x++);
cout << x << ':' << x++ << endl;
displays
2 4 3
6:5
Have to say I didn't expect 6:5 for the cout line. The order of _execution_ is guaranteed [starts with op <<(cout,x), ends with op <<(ostream,endl)], but the order of _evaluation_ isn't.
Here's another good one:
Code:
int x=5, y=100;
int z=x++ + x++ + y++;
printf("%d\n",z);
x=5; y=100;
printf("%d %d %d\n",x++,x++,y++);
Output:
110
6 5 100
It's very tempting to wonder how 6+5+100 makes 110.