protected virtual member function


void imbue (const locale& loc);
Imbue locale
Specifies the locale object to be used for conversions on input/output operations performed on the file stream buffer.

If loc is not the same locale as currently used by the file stream buffer, either the internal position pointer points to the beginning of the file, or its encoding is not state-dependent. Otherwise, it causes undefined behavior.

Imbuing a different locale may require the conversion of previously converted characters.

This virtual member function overrides the inherited member streambuf::imbue, called by member pubimbue to notify a change in imbued locale.

Note that the imbued locale object is kept by the streambuf base and shall not change between calls to this function.


The locale object being imbued.

Return Value


Data races

Modifies the filebuf object.
Concurrent access to the same file stream buffer object may introduce data races.

Exception safety

Basic guarantee: if an exception is thrown, the file stream buffer is in a valid state.

See also