vendredi 3 août 2018

how to insert objects into unordered_map in c++

I'm trying to insert objects into unordered_map in c++. I found a way to insert it map.insert(std::make_pair(key,object)). But, I couldn't get why we should use pair instead of the regular map[key]=value. And, I would like to know how to access the value from the key. map[key] is not working.

Aucun commentaire:

Enregistrer un commentaire