title: How do I access (check) the element of a std::unordered_map without inserting into it?
body: <p>Accessing elements of a std::unordered_map using the [ ] operator inserts new elements:</p>
  
  <pre><code>std::unordered_map&lt;std::string, uint32_t&gt; umap = {
      {"Thomas", 1},
      {"Frank", 5},
      {"Lisa", 7}
  };
  
  // umap.size() is 3
  uint32_t id = umap["Lisa"];
  // umap.size() is 3
  id = umap["Randy"]; // key "Randy" doesn't exist
  // umap.size() is 4
  </code></pre>
  
  <p>I had naively assumed the [ ] operator would behave read-only without right-hand assignment. Do I have to check via <code>count()</code> or <code>find()</code> whether a key exists, prior to accessing it, or is there an alternative?</p>