fork download
  1. #include<iostream>
  2. #include<set>
  3.  
  4. int main(){
  5. std::set<std::string> myset;
  6. auto it = myset.begin();
  7. it = myset.emplace_hint (it,"red");
  8. it = myset.emplace_hint (it,"orange");
  9. it = myset.emplace_hint (it,"yellow");
  10.  
  11. std::cout << "myset contains:";
  12. for (const std::string& mystring: myset)
  13. std::cout << ' ' << mystring;
  14. std::cout << '\n';
  15.  
  16. return 0;
  17. }
Success #stdin #stdout 0s 4452KB
stdin
Standard input is empty
stdout
myset contains: orange red yellow