C++ 23 · Containers and algorithms
Remove matching elements
Erase every element that satisfies a condition (C++20).
std::erase_if(v, [](int n) { return n % 2 == 0; });
C++ 23 · Containers and algorithms
Erase every element that satisfies a condition (C++20).
std::erase_if(v, [](int n) { return n % 2 == 0; });
Was this page helpful?