29 Nov
2007
29 Nov
'07
7:26 p.m.
John Kiopela wrote:
Hi all,
I have been browsing through the docs, but I couldn't find anything useful. Does Boost have a std::map<K, V>::iterator adaptor which iterates over the values of the map only. That is, I would like to have an iterator of which operator*() function returns V, instead of std::pair<K, V>. My data is stored in a std::map<K, V> and I would to allow my users to iterate over the values.
Off the top of my head, and untested: typedef std::map<K,V>::value_type pairkv; boost::make_transform_iterator( map, boost::bind(&pairkv::second, _1 ) ) will get you a value iterator; Jeff Flinn