11 May
2005
11 May
'05
7:34 a.m.
Dave Steffen wrote:
If anyone's interested: I'm playing with the idea of extending FOREACH in a way so that, instead of having a pair<>, you've got two separate variables for key and value. Maybe something like:
map
m; ... FOREACH_PAIR(int key, int value, m) { ... } I'm having a very moderate amount of success. Anyone else playing with this sort of thing?
Can't find the reference now, but someone suggested using tie() from the tuples library for this: int key, int value; BOOST_FOREACH(boost::tie(key, value), m) { ... } HTH, -- Eric Niebler Boost Consulting www.boost-consulting.com