title: Function operator= declared implicitly cannot be referenced - it is a deleted function
body: <pre><code>    std::vector&lt;Object&gt; vec(n); 
      for (auto &amp; member :vec)
      {
          member = anExistingObject;
      }
  </code></pre>
  
  <p>This code throws the error in the title. However, if I say</p>
  
  <pre><code>auto member = anExistingObject;
  </code></pre>
  
  <p>then it works fine. I just want to make a copy of <code>anExistingObject</code> for each vector element. Why does the first way throw the error?</p>