Angus Leeming <[EMAIL PROTECTED]> writes: | On Friday 09 August 2002 1:53 pm, Lars Gullik Bjønnes wrote: | > Angus Leeming <[EMAIL PROTECTED]> writes: | > | +void Counters::reset() | > | +{ | > | + CounterList::iterator it = counterList.begin(); | > | + CounterList::iterator end = counterList.end(); | > | + | > | + for (; it != end; ++it) { | > | + it->second.reset(); | > | + } | > | +} | > | > So my std::memfun didn't work?:-) | | that's it->second->, not it-> ... | | I could have
pity... I overlooked that. | struct Reset() { | void operator()(std::map::iterator it) { it->second.reset(); } | }; | | std::for_each(counterList.begin(), counterList.end(), Reset()); | | but I dodn't think that was more transparent ;-) I guess it could be done with the Boost.Lambda lib. -- Lgb