Can find_if be used to find a key in std::map/std::unordered_map?
This is a simple program consisting of adding an element into the std::unordered_map
. But before it’s added, first check if the key already exists, if it does then don’t add it.
This is a simple program consisting of adding an element into the std::unordered_map
. But before it’s added, first check if the key already exists, if it does then don’t add it.