The .reset() method of common smart pointers
<p>It seems to me that the reset method in the boost scoped_ptr and shared_ptr lead to incorrect order of construction and destruction:</p>

<pre><code>boost::scoped_ptr&lt;Component&gt; component(GetDefaultComponent());
component.reset(new BetterComponent); // 1. Creation of the new object
                                      // 2. Destruction of the old object
</code></pre>

<p>This is the wrong order IMO.</p>

<p>It is possible to first call the reset method without arguments and then set the new pointer. However that seems like a workaround to me. (And it being a "workaround" implies that there is something wrong.)</p>

<p>I am convinced that the boost people are very smart. So there must have been a rationale for the current approach.</p>

<p>Does anyone know more?</p>
