function template


template <class Facet> bool has_facet (const locale& loc) throw();
template <class Facet> bool has_facet (const locale& loc) noexcept;
Check if locale has facet
Returns whether facet Facet is present in locale loc.


locale object.

The template parameter Facet shall be a facet type.
A facet type is a type publicly derived (directly or indirectly) from locale::facet with a static member id of type locale::id, such as the standard facets collate, codecvt, ctype, messages, moneypunct, money_get, money_put, numpunct, num_get, num_put, time_get and time_put.

Return type

true if Facet is a facet present in loc. false otherwise.

Data races

Argument loc is accessed.

Exception safety

No-throw guarantee: this function never throws exceptions.

See also