Consider the following code:
std::ostream file;
if( file == NULL ) std::cout << "Failed to open file" << std::endl;
It compiles fine when passing -std = gnu11 (default from GCC 5.2) or just using
gcc code.cpp -o a.out.
It does not work with -std = gnu ++ 11 , though:
no match for ‘operator==’ (operand types are ‘std::ofstream {aka std::basic_ofstream<char>}’ and ‘long int’)`
What is the easiest workaround?
More details:
I need to use std = gnu ++ 11 to access definitions shared_ptr. In addition, some of my code is automatically generated, and changing the generator will be a reasonable effort - so I was wondering if anyone could come up with a simpler way to get rid of this "lack of compatibility".