Boost logo

Boost Users :

From: Vytautas Leonavicius (vyts_at_[hidden])
Date: 2004-07-30 11:04:16

I am often facing the same thing again and again. Say I have a map:
map< int, Foo* > m;

and I would like to invoke method of Foo on all instances

std::for_each(m.begin(), m.end(), boost::bind(&Foo::method, _1 );

The problem is that map contains pair of key and value, not Foo*. Usually I
create some function taking pair and invoking method needed on .second. But
maybe there is another way to do that?



Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at