fork(2) download
  1. #include <iostream>
  2. #include <map>
  3. #include <string>
  4. #include <tuple>
  5. #include <utility>
  6.  
  7. int main()
  8. {
  9. std::map<std::string, std::string> xs;
  10. auto key_args = std::make_tuple(10, 'a');
  11. auto value_args = std::make_tuple("Hello, world!");
  12. xs.emplace(std::piecewise_construct, key_args, value_args);
  13.  
  14. for (auto const& i : xs) {
  15. std::cout << i.first << '\n' << i.second << "\n\n";
  16. }
  17. }
  18.  
Success #stdin #stdout 0s 3432KB
stdin
Standard input is empty
stdout
aaaaaaaaaa
Hello, world!