How to check if weak_ptr is empty (non-assigned)? : <p>Is there a way to distinguish between an assigned (possibly expired) weak_ptr and a non-assigned one.</p>

<pre><code>weak_ptr&lt;int&gt; w1;
weak_ptr&lt;int&gt; w2 = ...;
</code></pre>

<p>I understand the following checks for either non-assignment or expiry, but is there a (cheaper?) check for only non-assignment?</p>

<pre><code>if (!w.lock()) { /* either not assigned or expired */ }
</code></pre>
