daily pastebin goal
53%
SHARE
TWEET

Untitled

a guest Feb 19th, 2019 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. map<string, int> myMap;
  2. myMap["one"] = 1;
  3. myMap["two"] = 2;
  4. myMap["three"] = 3;
  5.  
  6. map<string, int>::iterator it = myMap.find("two");
  7.  
  8. myMap.erase( it, myMap.end() );
  9.    
  10. myMap.erase( myMap.end() );
  11.    
  12. myMap.erase( myMap.end(), myMap.end() );
  13.    
  14. if ( it != myMap.end() )
  15.     myMap.erase( it );
  16.    
  17. map<int,int> m;
  18. for (int i = 0; i < 5; ++i)
  19.    m[i] = i;
  20. m.erase( m.find(1), m.find(4) );
  21.    
  22. for (int i = 1; i <= 4; ++i )
  23.    m.erase( m.find(i) );
  24.    
  25. a.erase( q1, q2)
  26.    
  27. a.erase(q)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top