$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
Subject: Re: [Boost-users] [lambda]How can I call function of objects in std::list while using std::for_each?
From: Alex MDC (alex.mdc_at_[hidden])
Date: 2009-03-22 23:17:40
>
> But DiscardableItem::Discard does not be called. How can I make it work?
> thanks! I think lambda can solve this problem easily.
>
You don't need boost::lambda here, you can easily solve this with
boost::bind
std::for_each( items.rbegin(), items.rend(),
boost::bind(&DiscardableItem::Discard, _1) );
If you *want* to use boost::lambda I'm sure someone else will help :)
Regards,
Alex