title: What should be the index type when iterating over the elements of a vector?
body: <p>I usually iterate over a vector that way:</p>
  
  <pre><code>for (int i = 0; i &lt; myVector.size(); i++) {
      Element* e = myVector[i];
  }
  </code></pre>
  
  <p>But then the compiler usually gives me this warning:</p>
  
  <pre><code>warning: C4018: '&lt;' : signed/unsigned mismatch
  </code></pre>
  
  <p>So if an <code>int</code> is not right, which type should the index be? vector::size() seems to be of a "size_type" type, but I'd rather use a more meaningful type. Any suggestion?</p>