title: Why is this struct's move asignement operator deleted?
body: <p>When I create an array of this struct and try to erase the first 2 members, it generates a compiler error (Visual Studio 2019):</p>
  
  <pre><code>struct A {
      virtual void unimplemented() = 0;
  };
  enum B {
      a, b, c, d, e, f
  };
  struct AorB {
      const bool isA;
      union {
          A* a;
          B b;
      };
      AorB(A* aVal) :a(aVal), isA(true) {};
      AorB(B bVal) :b(bVal), isA(false) {};
  };
  int main() {
      std::vector&lt;AorB&gt; vec{ a,b,c };
      vec.erase(vec.begin(), vec.begin() + 1);
  }
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>Error C2280 'AorB &amp;AorB::operator =(const AorB &amp;)': attempting to reference a deleted function  
  C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\include\xutility    3907    
  </code></pre>
  
  <p>I presume the move assignment operator is called when the vector rearranges it's elements but I don't see why it is deleted. I removed the union but it still produced this error.</p>