I can't use if ( ifs == NULL) command in VS 2013
c++
Solution
The definition of `std::basic_ios` (from which `std::basic_ifstream` inherits) changed in C++11. In particular, it's conversion operator `operator void*` changed to `explicit operator bool`, so what you're trying to do is no longer valid. Nonetheless, it was never a common way to check the state of your stream. Instead, just do `if (!ifs)`.
The C++ standard changes, now faster than ever, and MSVC has a habit of just mixing together the different standards until they fully support the latest one. You can expect some code to break when things change, although the committee aim to minimise this as much as possible.
Problem
When compiling this code: ``` std::ifstream ifs("somefile.txt"); if(ifs == NULL) ``` I get an error no operator matches these operands "==" I got the same error in every project with VS 2013, but I didn't have any problem in VS 2010. How to solve this?