title: Is the ranged based for loop beneficial to performance?
body: <p>Reading various questions here on Stack&nbsp;Overflow about C++ iterators and performance**, I started wondering if <code>for(auto&amp; elem : container)</code> gets "expanded" by the compiler into the best possible version? (Kind of like <code>auto</code>, which the compiler infers into the right type right away and is therefore never slower and sometimes faster).</p>
  
  <p>** For example, does it matter if you write </p>
  
  <pre><code>for(iterator it = container.begin(), eit = container.end(); it != eit; ++it)
  </code></pre>
  
  <p>or</p>
  
  <pre><code>for(iterator it = container.begin(); it != container.end(); ++it)
  </code></pre>
  
  <p>for non-invalidating containers?</p>