title: Why does moving a pointer variable not set it to null?
body: <p>When implementing move constructors and move assignment operators, one often writes code like this:</p>
  
  <pre><code>p = other.p;
  other.p = 0;
  </code></pre>
  
  <p>The implicitly defined move operations would be implemented with code like this:</p>
  
  <pre><code>p = std::move(other.p);
  </code></pre>
  
  <p>Which would be wrong, because moving a pointer variable does <em>not</em> set it to null. Why is that? Are there any cases were we would like the move operations to leave the original pointer variable unchanged?</p>
  
  <p>Note: By "moving", I do <em>not</em> just mean the subexpression <code>std::move(other.p)</code>, I mean the whole expression <code>p = std::move(other.p)</code>. So, why is there no special language rule that says "If the right hand side of an assignment is a pointer xvalue, it is set to null after the assignment has taken place."?</p>