title: Why is there a performance warning on cast pointer to bool?
body: <p><a href="https://stackoverflow.com/questions/1310344/why-use-when-converting-int-to-bool">Extends</a>.</p>
  
  <p>I thought I was being cool when I did something like:</p>
  
  <pre>
  bool hasParent()
  {
    return this-&gt;parentNode ;
  }
  </pre>
  
  <p>Even with a (bool) cast, the warning still doesn't go away.</p>
  
  <p>Where this-&gt;parentNode is NULL when there is no parent node.</p>
  
  <p>But I'm getting:</p>
  
  <pre>
  warning C4800: 'Node *' : forcing value to bool 'true' or 'false' (performance warning)
  </pre>
  
  <p>What's the deal, yo?  Why is that a performance warning?  I thought it'd be more efficient to not write something like:</p>
  
  <pre>
  
  bool hasParent()
  {
    if( this-&gt;parentNode )
      return true ;
    else
      return false ;
  }
  </pre>
  
  <p>But the second version generates no warnings and the compiler seems a lot happier.  Which is faster though?</p>