Is it a feature of unordered_map::find() to insert the key that we lookup with 0 value automatically? Let me make this clear

    unordered_map<int, int> tempMap;
    //some code
    if(tempMap.find(1) == tempMap.end()){
      //do something but not insert the 1 with a corresponding value into the tempMap
    }

so if I lookup 1 again, will it be there in the tempMap having 0 as corresponding value. Is that a feature of unordered_map?

没有正确的解决方案

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top