0

ALL,

class Foo
{
private:
    std::vector<std::string> vec;
};

void Foo::Remove(const std::string &table)
{
    vec.erase( std::remove_if( vec.begin(), vec.end, [](const std::string &str)
    {
        str.find( table ) != -1;
    }, vec.end() ) );
}

How do I proper capture the table parameter inside the lambda? And is my syntax correct? I need to remove the elements of vec that contain the table.

TIA!

cigien
  • 57,834
  • 11
  • 73
  • 112
Igor
  • 5,620
  • 11
  • 51
  • 103

0 Answers0