
16 Sep
2008
16 Sep
'08
9:19 a.m.
Robert Dailey skrev:
Hi,
Is there a way I can use std::for_each() on a boost::ptr_map and have the functor object be given the *value* of each item iterated instead of a key/value pair like it does with std::map? Help is appreciated, thank you.
You have wrap the iterators in new iterators that project the pair-like structur down to the value. It's the same for std::map. You can find functions for that in Neil Groves range_ex library in the file vault. -Thorsten