std::shared_ptr or std::unique_ptr assignment operator overloads
<p>I don't see a reason why these don't have an assignment operator overload for plain old pointers of the type they're templated to. If the goal of making smart pointers interface as close to plain old pointers as they could, then why didn't they make an overload for the assignment operator like this?</p>

<pre><code>inline std::shared_ptr&lt;type&gt; &amp;operator=( const type * pointer)
{
    reset(a);
}
</code></pre>

<p>this way you could use them just like you would a normal pointer, like so:</p>

<pre><code>std::shared_ptr&lt;int&gt; test = new int;
</code></pre>

<p>it's not an issue at all, just wondering why they went to the trouble of just overloading a couple of operators.</p>

<p>Also wondering if there's a way to overload the global assignment operator to do this, or if there's any reason i shouldn't.</p>

<p><strong>edit</strong>: adding a response to Nawaz about his answer here for code formatting. I just wrote this test program to see if what you were saying was right:</p>

<pre><code>template&lt;class T&gt;
class peh
{
public:
    peh() {meh = 3;}
    const peh&lt;T&gt; &amp; operator=(const int * peh)
    {
    }
};

void f( peh&lt;int&gt; teh)
{

}

int main()
{
    int * meh = new int;

    f(meh);

    system("PAUSE");
    return 0;
}
</code></pre>

<p>this here errors out saying there is no usable conversion from <code>peh&lt;int&gt;</code> to <code>int *</code>. so why is it acceptable with <code>std::shared_ptr&lt;int&gt;</code> to <code>int *</code>?</p>
