title: Can I safely move assign to `this`?
body: <p>I was wondering if it's safe to write a <code>reset</code> method of some class <code>A</code> by using the move assignment operator on <code>this</code>.</p>
  <p>So instead of</p>
  <pre class="lang-cpp prettyprint-override"><code>A a{};
  ... // Do something with a
  a = A();
  </code></pre>
  <p>if I could write</p>
  <pre class="lang-cpp prettyprint-override"><code>A a{};
  ... // Do something with a
  a.reset();
  </code></pre>
  <p>where</p>
  <pre class="lang-cpp prettyprint-override"><code>void A::reset()
  {
    *this = A();
  }
  </code></pre>
  <p>I played arround a bit on godbolt (<a href="https://godbolt.org/z/Edc3TT1aT" rel="noreferrer">https://godbolt.org/z/Edc3TT1aT</a> ) and the resulting debug assembly is almost identical with gdb for this example.</p>