C++ Locale Library - has_facet


Advertisements

Description

It is used to check if locale has facet and returns whether facet Facet is present in locale loc.

Declaration

Following is the declaration for std::has_facet.

C++98

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

C++11

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

Parameters

loc − It is a locale object.

Return Value

It returns whether facet Facet is present in locale loc.

Exceptions

No-throw guarantee − this function never throws exceptions.

Data races

It has accessed by Argument loc, and the returned object may be used to access facet object.

locale.htm
Advertisements