
3 Aug
2010
3 Aug
'10
9:48 a.m.
Hi Przemyslaw, On Tue, Aug 3, 2010 at 7:34 AM, <przemyslaw.sliwa@uk.bnpparibas.com> wrote:
All,
<snip code>
Since this looks really ugly I would like to ask you how this can be converto to find_if algorithm with a little help of boost::bind. I tried but could not succees.
It seemed necessary to add a nested bind call. #include "boost/bind.hpp" #include "boost/shared_ptr.hpp" #include <map> struct WTH { int cut; }; int main() { int cut; typedef std::multimap<int, boost::shared_ptr<WTH> > DataMap; std::find_if(myMap.begin(), myMap.end(), boost::bind(&WTH::cut, boost::bind(&DataMap::value_type::second, _1)) == cut); return 0; } HTH, Nate