title: std::vector abort problem
body: <p>I'm having diffuculty with the example below, the last line is producing an "abort has been called" error. I don't see why this should be.</p>
  
  <p>I'm using (*abc).def instead of abc->def for clarity in this case.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  #include &lt;vector&gt;
  
  class branch
  {
      public:
          unsigned short n;
          std::vector&lt;branch&gt; branches;
  
          branch left()
          {
              return branches.at(0);
          }
  };
  
  void main()
  {
      branch trunk = branch();
          trunk.n = 0;
          branch b1, b2;
          b1.n = 0;
          b2.n = 5;
          b1.branches.push_back(b2);
          trunk.branches.push_back(b1);
  
      branch* focus1 = &amp;(trunk.branches.at(0));
      branch* focus3 = &amp;(trunk.left());
  
      std::cout&lt;&lt;trunk.left().branches.at(0).n&lt;&lt;std::endl; // ok
      std::cout&lt;&lt;(*focus1).branches.at(0).n&lt;&lt;std::endl; // ok
      std::cout&lt;&lt;(*focus1).left().n&lt;&lt;std::endl; // ok
      std::cout&lt;&lt;(*focus3).branches.at(0).n&lt;&lt;std::endl; // problem
  }
  </code></pre>