title: Exceptions not catching for vectors
body: <p>I have tried to find this question elsewhere, but the problem I'm having still doesn't make sense to me. I'm using Visual C++ 2010 and my program is having out of range errors with vectors. The problem is, it never tells me which vector and the code is prohibitively large to check each one. I wanted to cut things down with try-catch, but I can't get them to catch. Here is some example code I made to demonstrate.</p>
  
  <pre><code>try{
      std::vector&lt;int&gt; test;
      for(int i=0; i&lt;10; i++){
          test.push_back(5);
  }
  if(test[10]=5)
  {
  }
  if(test[-1]=5)
  {
  }
  }
  catch(std::exception ex)//also tried exception&amp; and exception*
  {
    std::cout &lt;&lt; "blah";
  }
  catch(...){
    std::cout &lt;&lt; "blah";
  }
  </code></pre>
  
  <p>From other posts, I found suggestions about passing by reference, using ..., and a claim that vector exceptions were always caught by std::exception. </p>
  
  <p>So is there anything else that would keep this from catching?</p>