erase set c++ code example
Example 1: C++ remove element from set
std::set<int> s {1,2,3};
s.erase(2);
Example 2: c++ erase remove
std::vector<int> v = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
v.erase(std::remove(v.begin(), v.end(), 5), v.end());
// v will be {0 1 2 3 4 6 7 8 9}