title: unordered_map judge if the key is in the map
body: <p>I tried this piece of code</p>
  
  <pre><code> #include &lt;iostream&gt;
   #include &lt;utility&gt;
   #include &lt;vector&gt;
   #include &lt;unordered_map&gt;
   #include &lt;stdexcept&gt;
  
   using namespace std;
  
   int main() {
      unordered_map&lt;int,int&gt; parent_map;
      try {
          int a = parent_map[0];
          cout&lt;&lt;a&lt;&lt;endl;
  
      } catch (out_of_range oe) {
          cout&lt;&lt;"out of range"&lt;&lt;endl;
      }
  
      return 0;
  
   }
  </code></pre>
  
  <p>I think the out of range exception should be caught. However, the output is </p>
  
  <pre><code>0
  </code></pre>
  
  <p>I am confused. I remember I got this working before. </p>