Maybe a dummy question, but I need a clear answer to it. Is there any difference at all in the return of any of those functions
int FileExists(const std::string& filename)
{
ifstream file(filename.c_str());
return !!file;
}
int FileExists(const std::string& filename)
{
ifstream file(filename.c_str());
return file.is_open();
}
So in other words, my question is: does casting the fstream
to bool
give exactly the same result as fstream::is_open()
?