Is there a recommended way to test if a smart pointer is null? : <p>I'm trying to check if a <code>std::shared_ptr</code> is null. Is there a difference between doing</p>

<pre><code>std::shared_ptr&lt;int&gt; p;
if (!p) { // method 1 }
if (p == nullptr) { // method 2 }
</code></pre>
