fork(15) download
  1. #include <vector>
  2. #include <unordered_map>
  3. #include <string>
  4. #include <iostream>
  5.  
  6. using namespace std;
  7. int main()
  8. {
  9. typedef unordered_map<string, vector<int>> CMap;
  10. CMap category_map;
  11. category_map.insert(make_pair("hello", std::vector<int>(1, 5)));
  12. auto pr = category_map.insert(make_pair("hello", std::vector<int>(1, 5)));
  13. if (!pr.second)
  14. pr.first->second.push_back(10);
  15. cout << pr.first->second.size();
  16. }
  17.  
  18.  
Success #stdin #stdout 0s 3232KB
stdin
Standard input is empty
stdout
2