title: Forcing auto to be a reference type in a range for loop
body: <p>Suppose I have <code>foo</code> which is a populated <code>std::vector&lt;double&gt;</code>.</p>
  
  <p>I need to operate on the elements of this vector. I'm motivated to write</p>
  
  <pre><code>for (auto it : foo){
     /*ToDo - Operate on 'it'*/
  }
  </code></pre>
  
  <p>But it appears that this will not write back to <code>foo</code> since <code>it</code> is a value type: a deep copy of the vector element has been taken.</p>
  
  <p>Can I give some guidance to <code>auto</code> to make <code>it</code> a reference type? Then I could operate directly on <code>it</code>.</p>
  
  <p>I suspect I'm missing some trivial syntax.</p>