fork download
  1. #include <iostream>
  2. #include <string>
  3. #include <set>
  4.  
  5. int main ()
  6. {
  7. std::set<std::string> myset =
  8. {"USA","Canada","France","UK","Japan","Germany","Italy", "Finland"};
  9.  
  10. myset.erase ( myset.lower_bound( "F" ), myset.lower_bound( "G" ) );
  11.  
  12. std::cout << "myset contains:";
  13. for ( const std::string& x: myset ) std::cout << " " << x;
  14. std::cout << std::endl;
  15.  
  16. return 0;
  17. }
Success #stdin #stdout 0.01s 5472KB
stdin
Standard input is empty
stdout
myset contains: Canada Germany Italy Japan UK USA