title: Casting nullptr to bool
body: <p>In the pre-C++11 days it was considered better practice to write:</p>
  
  <pre><code>if (ptr == NULL)
  </code></pre>
  
  <p>Rather than:</p>
  
  <pre><code>if (!ptr)
  </code></pre>
  
  <p>This was for two reasons. It is more efficient because it didn't need to cast to bool. And there was no guarantee that the macro <code>NULL</code> would indeed evaluate to the boolean <code>false</code>. Is this still true in C++11? Is it preferable to write</p>
  
  <pre><code>if (ptr == nullptr)
  </code></pre>
  
  <p>Rather than</p>
  
  <pre><code>if (!ptr)
  </code></pre>
  
  <p>Or is the second fine now?</p>