Boost logo

Boost Users :

From: PJ Durai (pjdtech2000_at_[hidden])
Date: 2007-08-25 16:23:49


On 8/25/07, gast128 <gast128_at_[hidden]> wrote:
> PJ Durai <pjdtech2000 <at> gmail.com> writes:
>
> >
> > Hello everyone,
> >
> > remove_copy_if ( myEvents.begin(), myEvents.end(),
> > back_inserter(newEvents),
> > (boost::bind(&Event::GetEventType, _1) == NotesEventType_New)
> > && (boost::bind(&Event::GetEventID, _1) == 1000 ) );
> >
> > I have tried various ways of putting parens around this expression. I
> > just couldn't get it to compile. Is that even possible ? Please
> > Advise.
>
> 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)));

That worked. Thanks!

pj


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