Boost logo

Boost Users :

Subject: [Boost-users] bind for_each and a range of functors
From: Michael Marcin (mike.marcin_at_[hidden])
Date: 2008-10-16 17:20:53

Let's say I have a std::list of a functor with a member function

virtual operator()( int, int )

Is there an easy way to call each function in this list using for_each?

Intuitively I'd expect to be able to do something like:

void call_each( std::list<functor>& l )
    std::for_each( l.begin(), l.end(), boost::bind(_1,5,20) );


Michael Marcin

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