title: What is the advantage of using forwarding references in range-based for loops?
body: <p><code>const auto&amp;</code> would suffice if I want to perform read-only operations. However, I have bumped into</p>
  
  <pre><code>for (auto&amp;&amp; e : v)  // v is non-const
  </code></pre>
  
  <p>a couple of times recently. This makes me wonder:</p>
  
  <p>Is it possible that in some obscure corner cases there is some performance benefit in using forwarding references, compared to <code>auto&amp;</code> or <code>const auto&amp;</code>?</p>
  
  <p>(<code>shared_ptr</code> is a suspect for obscure corner cases)</p>
  
  <hr>
  
  <p><strong>Update</strong>
  Two examples that I found in my favorites:</p>
  
  <p><a href="https://stackoverflow.com/a/13057846/341970">Any disadvantage of using const reference when iterating over basic types?</a><br/>
  <a href="https://stackoverflow.com/a/13087074/341970">Can I easily iterate over the values of a map using a range-based for loop?</a></p>
  
  <p>Please concentrate on the question: <strong>why would I want to use auto&amp;&amp; in range-based for loops?</strong></p>