Boost logo

Boost Users :

From: PJ Durai (pjdtech2000_at_[hidden])
Date: 2007-08-24 18:57:05


Hello everyone,

I am not able to figure out the correct syntax for something I am trying to do.

The following works as expected. It filters all the 'new' events into
a new vector.

remove_copy_if ( myEvents.begin(), myEvents.end(),
                  back_inserter(newEvents),
                  !(boost::bind(&Event::GetEventType, _1) == EventType_New));

I cant figure out how to get a complex conditional working as the predicate.

e.g.

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.

I am using Visual C++ 2005 SP1 on Windows XP SP2.

Appreciate your time.

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