Should I stop using auto_ptr?
<p>I've recently started appreciating <code>std::auto_ptr</code> and now I read that it will be <a href="http://stackoverflow.com/questions/2404115/is-auto-ptr-deprecated">deprecated</a>. I started using it for two situations:</p>

<ul>
<li>Return value of a factory</li>
<li>Communicating ownership transfer</li>
</ul>

<p>Examples: </p>

<pre><code>// Exception safe and makes it clear that the caller has ownership.
std::auto_ptr&lt;Component&gt; ComponentFactory::Create() { ... }

// The receiving method/function takes ownership of the pointer. Zero ambiguity.
void setValue(std::auto_ptr&lt;Value&gt; inValue);
</code></pre>

<p>Despite the problematic copy semantics I find <code>auto_ptr</code> useful. And there doesn't seem to be an alternative for the above examples.</p>

<p>Should I just keep using it and later switch to <code>std::unique_ptr</code>? Or is it to be avoided?</p>
