A question about boost::lambda::if_ behavior
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?
6989
Age (days ago)
6989
Last active (days ago)
0 comments
1 participants
participants (1)
-
tom gee