title: VS2012 skipping lines
body: <p>I have such a code:</p>
  
  <pre><code>QVector&lt;Point&gt; legalMoves = field.getLegalMoves();
  QVector&lt;Cell&gt; costs;
  costs.reserve(legalMoves.size());
  for (QVector&lt;Point&gt;::iterator i = legalMoves.begin(); i &lt; legalMoves.end(); ++i)
      costs.push_back(checkCost(field, *i, player, -100, 100));
  Cell cost;
  if (player)  {
      QVector&lt;Point&gt;::iterator m1 = legalMoves.begin();
      QVector&lt;Cell&gt;::iterator m2 = costs.begin();
      QVector&lt;Cell&gt;::iterator j = costs.begin() + 1;
      for (QVector&lt;Point&gt;::iterator i = legalMoves.begin() + 1; i &lt; legalMoves.end(); ++i, ++j)
          if (j-&gt;status &gt; m2-&gt;status) {
              m1 = i;
              m2 = j;
          }
      cost=*m2;
  }
  else  {
      QVector&lt;Point&gt;::iterator m1 = legalMoves.begin();
      QVector&lt;Cell&gt;::iterator m2 = costs.begin();
      QVector&lt;Cell&gt;::iterator j = costs.begin() + 1;
      for (QVector&lt;Point&gt;::iterator i = legalMoves.begin() + 1; i &lt; legalMoves.end(); ++i, ++j)
          if (j-&gt;status &lt; m2-&gt;status) {
              m1 = i;
              m2 = j;
          }
      cost=*m2;
  }
  QVector&lt;Point&gt; moves;
  QVector&lt;Cell&gt;::iterator j = costs.begin();
  for (QVector&lt;Point&gt;::iterator i = legalMoves.begin(); i &lt; legalMoves.end(); ++i, ++j)
      if (j-&gt;status == cost.status)
          moves.push_back(*i);
  short index = qrand()%moves.size();
  return moves[index];            
  </code></pre>
  
  <p>}</p>
  
  <p>When i'm debugging it, compiler just skips this parts inside loops:</p>
  
  <pre><code>if (j-&gt;status &lt; m2-&gt;status) {
                  m1 = i;
                  m2 = j;
              }
  </code></pre>
  
  <p>which means the functions returns the very first Point(or any other Point with same Cell value instead of min/max). Why does that happen and how is it possible to fix it?</p>