title: Double Negation in C++
body: <p>I just came onto a project with a pretty huge code base. </p>
  
  <p>I'm mostly dealing with C++ and a lot of the code they write uses double negation for their boolean logic. </p>
  
  <pre><code> if (!!variable &amp;&amp; (!!api.lookup("some-string"))) {
         do_some_stuff();
   }                                   
  </code></pre>
  
  <p>I know these guys are intelligent programmers, it's obvious they aren't doing this by accident. </p>
  
  <p>I'm no seasoned C++ expert, my only guess at why they are doing this is that they want to make absolutely positive that the value being evaluated is the actual boolean representation. So they negate it, then negate that again to get it back to its actual boolean value. </p>
  
  <p>Is this correct, or am I missing something?</p>