18 Jul
2008
18 Jul
'08
11:32 a.m.
With Boost.Bind, however, the same trick does not work:
std::for_each( functors.begin(), functors.end(), boost::bind(::_1));
This does not invoke operator() on the functor objects.
For Boost.Bind there is boost::apply. #include "boost/bind/apply.hpp" for_each(f.begin(), f.end(), bind(apply<void>(), _1)); Roman Perepelitsa.