📜  c++ 擦除(remove_if) - C++ 代码示例

📅  最后修改于: 2022-03-11 14:44:53.228000             🧑  作者: Mango

代码示例1
class Anything{
public:    int func() };

list lst = ;

//removes every element in list that returned true in line 9
lst.erase(std::remove_if(lst.begin(), lst.end(),
                       [&](const Anything lst)-> bool
                       { return lst.func() == something; }), //any condition
        lst.end());