📜  在条件c ++代码示例中从向量中删除元素

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

代码示例2
v.erase(std::remove_if(
    v.begin(), v.end(),
    [](const int& x) { 
        return x > 10; // put your condition here
    }), v.end());
// therefore elements > 10 are removed, leaving only elements<= 10