JOAQUIN LOPEZ MU?Z wrote:
Hi Nebojsa,
----- Mensaje original ----- De: Nebojsa Simic
Fecha: Sábado, Noviembre 17, 2007 0:05 am Asunto: Re: [Boost-users] [multiindex] [bind] Update members of the container between two iterators (was: Conversion loses qualifiers) Para: boost-users@lists.boost.org Nebojsa Simic wrote: [...]
for_each( it , idxResponse.end() , boost::bind( &StatisticsByResponse::modify, boost::ref(idxResponse), ::_1, fnAddStats ) );
but it still does not compile (problem with boost::bind "wrong number of arguments").
the call : idxResponse.modify( it, fnAddStats ); works, so the problem is not the first bind, but the one in for_each. [...]
You can't use for_each(it1,it2,someFunctor) to do what you want because modify() needs an iterator, and for_each passes a value reference to someFunctor rather than the iterator. So, you've got to resort to a handmade loop like:
So, the current status is:
// TEMPLATE FUNCTION for_each_it
template