jeudi 7 octobre 2021

Using find function for two dimensional map, how to access value of the map found?

I have a map: map<string1, map<string2, pointer>> myMap They keys of my first map repeat. I am using the find function for my string1 to get my pointer and adding it to a list:

myList.push_back(myMap.find("key") -> second )

but the keys repeat so I have to use a loop to find all those maps associated with the key-string1 and then access the inner map to get the pointer. How would I go about this?

Aucun commentaire:

Enregistrer un commentaire