Boost logo

Boost Users :

From: tom gee (rockonedge_at_[hidden])
Date: 2005-09-22 02:40:29


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?



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net