fork download
  1. #include <iostream>
  2. #include <map>
  3. #include <vector>
  4. #include <string>
  5. using namespace std;
  6.  
  7. std::map<std::string, std::vector<std::string>> f10List;
  8.  
  9. void f1()
  10. {
  11. std::vector<std::string> rtList1 = {"ALD_R-1/LNA_R-1", "ALD_R-1/LNA_R-2"};
  12. std::vector<std::string> rtList2 = {"ALD_R-2/LNA_R-1", "ALD_R-2/LNA_R-2"};
  13. f10List["001"].swap(rtList1);
  14. //f10List["001"].clear();
  15. for (auto &item : f10List["001"])
  16. {
  17. cout << item << " ";
  18. }
  19. }
  20.  
  21. int main() {
  22. f1();
  23. cout << endl << "Hello world!" << endl;
  24. return 0;
  25. }
Success #stdin #stdout 0.01s 5448KB
stdin
Standard input is empty
stdout
ALD_R-1/LNA_R-1 ALD_R-1/LNA_R-2 
Hello world!