Boost logo

Boost Users :

From: Nat Goodspeed (nat.goodspeed_at_[hidden])
Date: 2007-08-25 11:34:38


At 07:07 AM 8/25/2007, gast128 wrote:

> > remove_copy_if ( myEvents.begin(), myEvents.end(),
> > back_inserter(newEvents),
> > (boost::bind(&Event::GetEventType, _1) == NotesEventType_New)
> > && (boost::bind(&Event::GetEventID, _1) == 1000 ) );
>
>maybe this works:
>
>const std::vector<Event> v;
>std::vector<Event> vOut;
>
>std::remove_copy_if(v.begin(), v.end(),
> back_inserter(vOut),
> boost::bind(std::logical_and<bool>(),
> (boost::bind(&Event::GetEventType, _1) == 0),
> (boost::bind(&Event::GetEventID, _1) == 1)));

   Alternatively, using boost::lambda::bind rather than boost::bind
might permit you to use your original && syntax. (I haven't tried, though.)


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