
22 Sep
2005
22 Sep
'05
7:40 a.m.
Can anyone please explain this code: for_each( setFinalVal.begin(), setFinalVal.end(), ( cout<<_1<<" ", if_(_1 < 24.000001 && _1 > 23.999999)[ cout <<"Bingo:<"<< _1<<">"]) ); where setFinalVal is defined as set<double>. I expect it to result in: -32 -24 -16 -12 -11 -10 -9 -8 -7 -5 -4 -3 -2 0 4 5 6 7 8 9 11 12 13 14 24 Bingo:<24>32 40 However, compiled with VC++2005 express, it results in: Bingo:<-32 -24 -16 -12 -11 -10 -9 -8 -7 -5 -4 -3 -2 0 4 5 6 7 8 9 11 12 13 14 24 24>32 40 Why?