Open jamiebullock opened 7 years ago
It's not clear to me how to correctly handle errors when using the following idiom:
std::ofstream os(path, std::ios_base::out | std::ios_base::binary); if (!os) { throw std::runtime_error(...); } os << is.rdbuf(); is.close(); os.close();
Should I for example check after os << is.rdbuf() using something like:
os << is.rdbuf()
if (!is) { throw std::runtime_error(is.error().message()); }
It's not clear to me how to correctly handle errors when using the following idiom:
Should I for example check after
os << is.rdbuf()
using something like: