Use std::ifstream instead of std::fstream.