mardi 27 janvier 2015

How do you properly use the result of std::unordered_map::find in c++11

I have some piece of code that looks like this:



std::unordered_map<std::string, std::shared_ptr<Foo>> map;
auto result = map.find("key i'm looking for");


when I try to use result in this fashion:



result->second->Bar()


my IDE can't autocomplete and tells me "No suggestions for members of auto0"


Is my syntax wrong or is it a shortcoming of the API?


Aucun commentaire:

Enregistrer un commentaire