remove first element from set c++ code example
Example 1: C++ remove element from set
std::set<int> s {1,2,3};
s.erase(2);
Example 2: remove first element of set
Set<String> set = Collections.newSetFromMap(new LinkedHashMap<String, Boolean>(){
protected boolean removeEldestEntry(Map.Entry<String, Boolean> eldest) {
return size() > MAX_ENTRIES;
}
});
Example 3: remove an element from a set
list.remove(element)