Check out example codes for "erase in set". It will help you in understanding the concepts better.

Code Example 1

std::set<int> s {1,2,3};

Code Example 2

// CPP program to illustrate 
// Implementation of erase() function 
#include <iostream> 
#include <set> 
using namespace std; 
int main() 
    // set declaration 
    set<char> myset{ 'A', 'C', 'E', 'G' }; 
    set<char>::iterator it1, it2; 
    // defining it1 pointing to the first 
    // element and it2 to the last element 
    it1 = myset.begin(); 
    it2 = myset.end(); 
    // decrementing the it2 two times 
    // erasing elements within the 
    // range of it1 and it2 
    myset.erase(it1, it2); 
    // Printing the set 
    for (auto it = myset.begin(); 
        it != myset.end(); ++it) 
        cout << ' ' << *it; 
    return 0; 

Learn ReactJs, React Native from