
30 Aug
2005
30 Aug
'05
2:39 p.m.
I like the BOOST_FOREACH macro, and I'm going to be spending a lot of time playing around with it. For working with iterator ranges, however, this sort of thing seems to be the best that I can come up with: //pFirst and pLast are iterators that return an int on dereference //they could be some_containter<int>.rbegin() and some_container<int>.rend(), for example BOOST_FOREACH(int i, vector<int>(pFirst,pLast)); It's not that ugly, but creating a new vector to do a loop is quite an efficiency hit. Is there an better way to do this? Joel Eidsath