
14 Sep
2009
14 Sep
'09
7:05 a.m.
Chris Purcell <chris.purcell.39 <at> gmail.com> writes:
As documented in the manual ("Pitfalls"), BOOST_FOREACH is a little awkward to use with associative containers. I've used the following in the past to simplify my own code, and wondered if it was suitable to add to the Boost Foreach library proper.
std::map<int, int> my_map; BOOST_FOREACH_PAIR(int key, int value, my_map) std::cout << key << " : " << value << "\n";
Can you provide a link to the code? I'd like to test it. Markus