
I am currently trying to get to grips with using Lambda, but I have hit a problem fairly early on. Can anyone explain what I am doing wrong. bool isCar(std::string const & val) { return val.find("car") != std::string::npos; } int main() { std::liststd::string l; l.push_back("car"); l.push_back("blue car"); l.push_back("red van"); l.push_back("bike"); l.push_back("blue car"); // ... l.remove_if(&isCar); // this works and is how I have done things in the past but I was hoping to avoid the need for the separate function by using Lambda. // I have tried the following l.remove_if(boost::lambda::var(boost::lambda::bind(&std::string::find, boost::lambda::_1, "car")) != std::string::npos); // I am not sure why this does not work, can anyone point me in the right direction? }