Boost logo

Boost Users :

Subject: [Boost-users] Simple Lambda Problem
From: Richard Howard (rhphotography.net_at_[hidden])
Date: 2011-04-07 04:02:58

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::list<std::string> l;
   l.push_back("blue car");
   l.push_back("red van");
   l.push_back("blue car");

   // ...


   // 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

boost::lambda::_1, "car")) != std::string::npos);

   // I am not sure why this does not work, can anyone point me in the
right direction?

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at