Boost logo

Boost Users :

Subject: Re: [Boost-users] using bind with find_if
From: Igor R (boost.lists_at_[hidden])
Date: 2011-03-09 16:33:53


> I don't want to find elements equal to a specific element.  I want to find
> an element that meets specific criteria -- that is, find the element for
> which two of its data members have specific values.  If I already had all
> the criteria for the element, I wouldn't need to find it in the first place!

I see...
You can do something like this:

std::find_if(FOverridesContainer.begin(), FOverridesContainer.end(),
boost::bind(OverrideMatches(), _1, ChildItemRecNo, LinkItemRecNo));

or with Boost.Range algorithm:

boost::find_if(FOverridesContainer, boost::bind(OverrideMatches(), _1,
ChildItemRecNo, LinkItemRecNo));


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