
2 May
2005
2 May
'05
3:28 p.m.
"Eric Niebler" <eric@boost-consulting.com> wrote
bool first = true; BOOST_FOREACH(....) { if(first) { do_something(); first = false; } }
Wanting the last element is very nearly as common as wanting the first. Putting this after the loop requires an extra check for an empty container. Why do you not wish to expose the iterator in BOOST_FOR_EACH ? regards Andy Little