Find mapped value of map

Because of how a map is designed, you’ll need to do the equivalent of a search on unordered data.

for (auto it = someMap.begin(); it != someMap.end(); ++it)
    if (it->second == someValue)
        return it->first;

Leave a Comment