title: should std::auto_ptr<>::operator = reset / deallocate its existing pointee?
body: <p>I read <a href="http://www.cplusplus.com/reference/std/memory/auto_ptr/operator=/" rel="nofollow noreferrer">here</a> about std::auto_ptr&lt;>::operator=</p>
  
  <blockquote>
    <p>Notice however that the left-hand side
    object is not automatically
    deallocated when it already points to
    some object. You can explicitly do
    this by calling member function reset
    before assigning it a new value.</p>
  </blockquote>
  
  <p>However, when I read the source code for header file <code>C:\Program Files\Microsoft Visual Studio 8\VC\ce\include\memory</code></p>
  
  <pre><code>template&lt;class _Other&gt;
      auto_ptr&lt;_Ty&gt;&amp; operator=(auto_ptr&lt;_Other&gt;&amp; _Right) _THROW0()
      { // assign compatible _Right (assume pointer)
      reset(_Right.release());
      return (*this);
      }
  
  auto_ptr&lt;_Ty&gt;&amp; operator=(auto_ptr&lt;_Ty&gt;&amp; _Right) _THROW0()
      { // assign compatible _Right (assume pointer)
      reset(_Right.release());
      return (*this);
      }
  
  auto_ptr&lt;_Ty&gt;&amp; operator=(auto_ptr_ref&lt;_Ty&gt; _Right) _THROW0()
      { // assign compatible _Right._Ref (assume pointer)
      _Ty **_Pptr = (_Ty **)_Right._Ref;
      _Ty *_Ptr = *_Pptr;
      *_Pptr = 0; // release old
      reset(_Ptr); // set new
      return (*this);
      }
  </code></pre>
  
  <p>What is the correct/standard behavior? How do other STL implementations behave? If the website cited above has wrong/outdated information, which website do you recommend as a reference?</p>