title: Performance issue for vector::size() in a loop in C++
body: <p>In the following code:</p>
  
  <pre class="lang-cpp prettyprint-override"><code>std::vector&lt;int&gt; var;
  for (int i = 0; i &lt; var.size(); i++);
  </code></pre>
  
  <p>Is the <code>size()</code> member function called for each loop iteration, or only once?</p>