title: std::map out_of_range exception not being caught
body: <p>I'm using the asio networking library. I'm seeing a very strange behaviour where the debugger tells me that the call to std::map::at() throws an out_of_range exception, however I have catch block to catch precisely that type of exception! </p>
  
  <p>The map in question is this:</p>
  
  <pre><code>/*Both of these maps are global variables in the namespace cloud*/
  map&lt;string, weak_ptr&lt;session&gt; &gt; cloud::services;
  map&lt;string, vector&lt;weak_ptr&lt;session&gt; &gt; &gt; cloud::subscribed; //this one
  </code></pre>
  
  <p>And the code that's throwing the exception is this:</p>
  
  <pre><code>void session::subscribirse(std::string a_which)
  {
    try
    {
      //We obtain a reference to the group of sockets subscribed to this service name
      vector&lt;weak_ptr&lt;session&gt;&gt;&amp; grupo = cloud::subscribed.at(a_which);   //HERE
      grupo.emplace_back(shared_from_this() );
    }
    catch(out_of_range&amp; e) //The group didn't exist (no-one had subscribed to it yet)
    {
      vector&lt;weak_ptr&lt;session&gt;&gt; new_group;
      new_group.emplace_back(shared_from_this());
      cloud::subscribed.emplace(make_pair(a_which, new_group));
    }
    catch(...)
    {
      cout &lt;&lt; "unexpected exception during subscribe\n";
    }
    subscriptions_.emplace_back(a_which);
    consumed_ = true;
  }
  </code></pre>
  
  <p>Could the catch-block be rethrowing and the debugger not being capable of detecting that? (I really don't think so).</p>
  
  <p>Sorry if question is not clear, I've spent the last 6 hours and I'm feeling desperate.</p>