A colleague just told me that this code:
std::ifstream stream(filename.c_str()); if (!stream) { throw std::runtime_error(\"..\"); }
wou
Your colleague is wrong. Perhaps he's forgotten that you're not writing C.
The code is spot on. It's exactly how you should be checking stream state.