53 lines
1.6 KiB
Markdown
53 lines
1.6 KiB
Markdown
[locale.global.templates]
|
||
|
||
# 28 Text processing library [[text]](./#text)
|
||
|
||
## 28.3 Localization library [[localization]](localization#locale.global.templates)
|
||
|
||
### 28.3.3 Locales [[locales]](locales#locale.global.templates)
|
||
|
||
#### 28.3.3.2 locale globals [locale.global.templates]
|
||
|
||
[ð](#lib:locale,use_facet)
|
||
|
||
`template<class Facet> const Facet& use_facet(const locale& loc);
|
||
`
|
||
|
||
[1](#1)
|
||
|
||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L1177)
|
||
|
||
*Mandates*: Facet is a facet class
|
||
whose definition contains the public static member id as defined in [[locale.facet]](locale.facet "28.3.3.1.2.2 Class locale::facet")[.](#1.sentence-1)
|
||
|
||
[2](#2)
|
||
|
||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L1183)
|
||
|
||
*Returns*: A reference to the corresponding facet of loc, if present[.](#2.sentence-1)
|
||
|
||
[3](#3)
|
||
|
||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L1187)
|
||
|
||
*Throws*: bad_cast if has_facet<Facet>(loc) is false[.](#3.sentence-1)
|
||
|
||
[4](#4)
|
||
|
||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L1191)
|
||
|
||
*Remarks*: The reference returned remains valid
|
||
at least as long as any copy of loc exists[.](#4.sentence-1)
|
||
|
||
[ð](#lib:locale,has_facet)
|
||
|
||
`template<class Facet> bool has_facet(const locale& loc) noexcept;
|
||
`
|
||
|
||
[5](#5)
|
||
|
||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L1203)
|
||
|
||
*Returns*: true if the facet requested is present in loc;
|
||
otherwise false[.](#5.sentence-1)
|