title: list iterator not incrementable
body: <p>I have an old project that was built using visual studio 2003 and I recompiled it with vs2005 recently.  However, during runtime, I get the following error:</p>
  
  <p>list iterator not incrementable</p>
  
  <p>I traced the program to this function:</p>
  
  <pre><code>void InputQueue::update()
  {
      list&lt;PCB&gt;::iterator iter;
      list&lt;PCB&gt;::iterator iterTemp;
      for(iter = begin(); iter != end(); iter++)
      {
          if(iter-&gt;arrivalTime == 0)
          {           
              ReadyQueue::getInstance()-&gt;add(*iter);
              iterTemp = iter;
              iter++;
              erase(iterTemp);
          }
      }
  }
  </code></pre>
  
  <p>I'm not a C++ expert and this is as far as the VS debugger got me.  Could somebody explain to me what the problem is?</p>
  
  <p>Thanks</p>