25 Localization library [localization]

25.3 Locales [locales]

25.3.2 locale globals [locale.global.templates]

template <class Facet> const Facet& use_facet(const locale& loc);

Requires: Facet is a facet class whose definition contains the public static member id as defined in [locale.facet].

Returns: A reference to the corresponding facet of loc, if present.

Throws: bad_­cast if has_­facet<Facet>(loc) is false.

Remarks: The reference returned remains valid at least as long as any copy of loc exists.

template <class Facet> bool has_facet(const locale& loc) noexcept;

Returns: true if the facet requested is present in loc; otherwise false.