cpp/io/basic osyncstream

The class template is a convenience wrapper for. It provides a mechanism to synchronize threads writing to the same stream.

It can be used with a named variable:

as well as with a temporary:

It provides the guarantee that all output made to the same final destination buffer (std in the examples above) will be free of data races and will not be interleaved or garbled in any way, as long as every write to that final destination buffer is made through (possibly different) instances of.

Typical implementation of holds only one member: the wrapped std.