title: Not able to erase vector element using iterator, vector element implements the move constructor
body: <p>I have a vector of struct Cache. Cache which implements Move constructor. Whenever I try to iterate over this vector and try to erase an element on specific condition it fails to compile.</p>
  
  <pre><code>struct Cache {
      Cache() {}
  
      Cache(Cache&amp;&amp; other)
          : serviceName(std::move(other.serviceName))
      {}
  
      ~Cache() {}
  
      size_t referenceCount;
      std::string serviceName;
  };
  
  std::vector&lt;Cache&gt; vectorCaches;
  auto iter = vectorCaches.begin();
  while(iter != vectorCaches.end()) {
       if(iter-&gt;serviceName == "Sample") {
           iter = vectorCaches.erase(iter); //compiler error here
       } else {
           iter++;
       }
  }
  </code></pre>
  
  <p>Compiler error:</p>
  
  <blockquote>
    <p>error: use of deleted function 'Cache&amp; Cache::operator=(const Cache&amp;)'
            <em>__result = std::move(</em>__first);
                      ^ note: 'Cache&amp; Cache::operator=(const Cache&amp;)' is implicitly declared as deleted because 'Cache' declares a move
    constructor or move assignment operator
         struct Cache {</p>
  </blockquote>
  
  <p>Is there any workaround to achieve erase when vector element implements move constructor? Any help is appreciated.</p>