Associates loc to both the stream and its associated stream buffer (if any) as the new locale object to be used with locale-sensitive operations.
This function calls its inherited homonym ios_base::imbue(loc) and, if the stream is associated with a stream buffer, it also calls rdbuf()->pubimbue(loc).
This code writes a floating point number using the global locale given by the environment. For example, in a system configured with a Spanish locale as default, this could write the number using a comma decimal separator:
3,14159
Data races
Modifies the stream object.
Concurrent access to the same stream object may cause data races.
Exception safety
Basic guarantee: if an exception is thrown, the stream is in a valid state.