title: C++ : List iterator not incrementable
body: <p>Getting this error while trying to erase the last element of a list. I debugged the code and was able to figure out what causes it and where, here's my code:</p>
  
  <pre><code>    for(Drop_List_t::iterator i = Drop_System.begin(); i != Drop_System.end() &amp;&amp; !Drop_System_Disable; /**/)
  {
      if(Player-&gt;BoundingBox.Intersect(&amp;(*i)-&gt;BoundingBox))
      {
          i = Drop_System.erase(i);
      }
  
      ++i; //List iterator crashes here if last entry was deleted
  }
  </code></pre>
  
  <p>I can't figure out what I'm doing wrong... Any suggestions?</p>