Does anybody know why
vector<int> test(10);
int a=0;
for_each(test.begin(),test.end(),(_1+=var(a),++var(a)));
for_each(test.begin(),test.end(),(cout << _1 << " "));
cout << "\n"
Gives : "0 1 2 3 4 5 6 7 8 9"
but
transform(test.begin(),test.end(),test.begin(), (_1+=var(a),++var(a)));
...(as before)
Gives : "1 2 3 4 5 6 7 8 9 10"
?