fork(1) download
  1. #include <iostream>
  2. #include <set>
  3. #include <map>
  4.  
  5. int main() {
  6. std::map<std::string, std::string> m;
  7. m["hello"] = "world";
  8. m["foo"] = "bar";
  9.  
  10. std::set<std::pair<std::string, std::string>> s(m.begin(), m.end());
  11. for(auto it : s) {
  12. std::cout << it.first << ", " << it.second << std::endl;
  13. }
  14.  
  15. return 0;
  16. }
Success #stdin #stdout 0s 4428KB
stdin
Standard input is empty
stdout
foo, bar
hello, world