Boost logo

Boost Users :

From: Manfred Doudar (manfred.doudar_at_[hidden])
Date: 2006-08-11 00:02:39


Roman Perepelitsa wrote:
>
> Try this:
> bind(Predicate(), bind(&Xtype::the_value, _1), 10)
>

Thank you kindly Roman, that helped - and is obvious now that I see it,
again many thanks.

I do however have one more boost::bind question that I can't quite get
myself around.

I want replace the following for-loop with a call to std::for_each, and
am near certain that bind would do it:

std::list<boost::tuple<int, float, std::string> > li;

...

for (std::list<boost::tuple<int, float, std::string> >::iterator it =
li.begin(); it != li.end(); ++it)
{
     // this is ok - is all part of a class that inherits from MyFunctor

     MyFunctor::operator()(boost::get<0> (*it));
}

How might I convert the above to something using std::for_each, and
boost::bind?

Again, with thanks in advance

-- 
Manfred

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net