[ios.base.locales]

# 31 Input/output library [[input.output]](./#input.output)

## 31.5 Iostreams base classes [[iostreams.base]](iostreams.base#ios.base.locales)

### 31.5.2 Class ios_base [[ios.base]](ios.base#locales)

#### 31.5.2.4 Functions [ios.base.locales]

[ð](#lib:imbue,ios_base)

`locale imbue(const locale& loc);
`

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L1323)

*Effects*: Calls each registered callback pair(fn, idx) ([[ios.base.callback]](ios.base.callback "31.5.2.7 Callbacks"))
as(*fn)(imbue_event, *this, idx) at such a time that a call toios_base​::​getloc() from withinfn returns the new locale valueloc[.](#1.sentence-1)

[2](#2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L1336)

*Postconditions*: loc == getloc()[.](#2.sentence-1)

[3](#3)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L1340)

*Returns*: The previous value ofgetloc()[.](#3.sentence-1)

[ð](#lib:getloc,ios_base)

`locale getloc() const;
`

[4](#4)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L1352)

*Returns*: If no locale has been imbued, a copy of the global C++ locale,locale(),
in effect at the time of construction[.](#4.sentence-1)

Otherwise, returns the imbued locale, to be used to
perform locale-dependent input and output operations[.](#4.sentence-2)
