Check out example codes for "inserting an element in an set c++". It will help you in understanding the concepts better.

Code Example 1

// CPP program to demonstrate the 
// set::insert(element) function 
#include <bits/stdc++.h> 
using namespace std; 
int main() 
    set<int> s; 
    // Function to insert elements 
    // in the set container 
    cout << "The elements in set are: "; 
    for (auto it = s.begin(); it != s.end(); it++) 
        cout << *it << " "; 
    return 0; 

Learn ReactJs, React Native from