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 

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 ;-)


Angus

Reply via email to