Here's a radical thought: should stdout even be global?

With any other file, this wouldn't be an issue because File's dtor calls close() which (I'm pretty sure) flushes the file, and thus would detect the error at the latest, when it goes out of scope.

I think if stdout wasn't global, I'd be among those complaining about the code it breaks and the hassle it brings, but it seems to me that this is the real problem here. It doesn't go out of scope until the program is terminating.

Reply via email to