C++ remove element from set code example Example: C++ remove element from set std::set s {1,2,3}; s.erase(2);