C++ iostreams: Unexpected but legal multithreaded behaviour
berthub.eu