c++ remove from vector if condition code example
Example: remove element from vector on condition c++
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