[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 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(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 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)