title: std::ofstream == NULL won't compile for -std=gnu++11, any workaround?
body: <p>Consider the following code:</p>
  
  <pre><code>std::ostream file;
  if( file == NULL ) std::cout &lt;&lt; "Failed to open file" &lt;&lt; std::endl;
  </code></pre>
  
  <p>It compiles perfectly when passing <strong>-std=gnu11</strong> (default from GCC 5.2), or just using<br>
  <code>gcc code.cpp -o a.out</code>.</p>
  
  <p>It fails with <strong>-std=gnu++11</strong>, though: </p>
  
  <pre><code>no match for ‘operator==’ (operand types are ‘std::ofstream {aka std::basic_ofstream&lt;char&gt;}’ and ‘long int’)`
  </code></pre>
  
  <p>What is the simplest workaround?</p>
  
  <p>Details:</p>
  
  <p>I've got to use std=gnu++11 to have access to <code>shared_ptr</code> definitions. Furthermore, some code of mine is automatically generated and modifying the generator would incur in a reasonable effort - so I was wondering if someone could come up with simpler way to get rid of this "lack of compatibility".</p>