4 ms·
Interesting corner case that I can't say I've ever seen before. fstream is a bit of a mess. Even the documentation for close is a bit contradictory. Its except
by laurowyn 6y ago
Interesting corner case that I can't say I've ever seen before.
fstream is a bit of a mess. Even the documentation for close is a bit contradictory. Its exception safety states that an exception is caught and rethrown after closing the file if one is thrown by an internal operation. That to me sounds like the actual resource being managed will be closed (assuming the fd is valid), but any data may not be flushed out of the write buffer.
sounds to me like iostream needs some serious attention in future specs, but that's unlikely to happen unfortunately. Creating new toys > fixing old ones.