Files
2025-10-25 03:02:53 +03:00

53 lines
1.6 KiB
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[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.2Class 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)