fork(1) download
  1. #include <map>
  2. #include <vector>
  3. #include <string>
  4. #include <iostream>
  5.  
  6. int main() {
  7. std::multimap<std::pair<std::string, std::string>, std::vector<double>> mmList;
  8. std::vector<double> test = { 1.1, 2.2, 3.3 };
  9.  
  10. mmList.emplace(std::make_pair("a", "b"), test);
  11.  
  12. mmList.emplace(std::piecewise_construct,
  13. std::forward_as_tuple("a", "b"),
  14. std::forward_as_tuple(test));
  15.  
  16. for (auto const& kv : mmList) {
  17. std::cout << "(" << kv.first.first << ", " << kv.first.second << ") =";
  18. for (auto const& d : kv.second) {
  19. std::cout << " " << d;
  20. }
  21. std::cout << std::endl;
  22. }
  23.  
  24. return 0;
  25. }
Success #stdin #stdout 0s 4392KB
stdin
Standard input is empty
stdout
(a, b) = 1.1 2.2 3.3
(a, b) = 1.1 2.2 3.3