📜  c++ unordered_map 检查键是否存在 - C++ 代码示例

📅  最后修改于: 2022-03-11 14:44:58.404000             🧑  作者: Mango

代码示例1
bool checkKey (int key, const std::unordered_map &m) {
  if (m.find(key) == m.end()) {
    return false; //Key is not in the map
  }
  
  return true; //Key is in the map
}