Check out example codes for "c++ map insert". It will help you in understanding the concepts better.

Code Example 1

mymap.insert ( std::pair<char,int>('a',100) );

Code Example 2

 // initialize container 
    map<int, int> mp; 
  
    // insert elements in random order 
    mp.insert({ 2, 30 }); 
    mp.insert({ 1, 40 }); 
  
    auto it = mp.find(2); 
  
    // inserts {3, 6} starting the search from 
    // position where 2 is present 
    mp.insert(it, { 3, 60 }); 
  

Learn ReactJs, React Native from akashmittal.com