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;
More Related Contents:
- How can I use std::maps with user-defined types as key?
- How to retrieve all keys (or values) from a std::map and put them into a vector?
- In STL maps, is it better to use map::insert than []?
- How can I use an array as map value?
- C++ Thread-Safe Map
- Checking value exist in a std::map – C++
- std::map thread-safety
- Why Can’t I store references in a `std::map` in C++?
- c++ push reference node to stl list
- Insert into map with pair as key and list as value [closed]
- Is there any advantage of using map over unordered_map in case of trivial keys?
- Why does the C++ map type argument require an empty constructor when using []?
- Initializing a static std::map in C++
- Why is std::map implemented as a red-black tree?
- How can I create my own comparator for a map?
- Is the order of iterating through std::map known (and guaranteed by the standard)?
- What is the default constructor for C++ pointer?
- C++ Loop through Map
- How to choose between map and unordered_map?
- Super high performance C/C++ hash map (table, dictionary) [closed]
- Unresolved externals in C++ when using vectors and find
- How can I sort an STL map by value?
- C++ std::map holding ANY type of value
- Using std::map where V has no usable default constructor
- How can I make the map::find operation case insensitive?
- What would a std::map extended initializer list look like?
- What is difference between const and non const key?
- Are IEEE floats valid key types for std::map and std::set?
- map with incomplete value type
- C++ inserting unique_ptr in map