A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://en.cppreference.com/w/cpp/language/../error/error_code/../../../cpp/locale/has_facet.html below:

std::has_facet - cppreference.com

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

(until C++11)

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

(since C++11)

Checks if the locale loc implements the facet Facet.

The program is ill-formed if Facet is not a facet or it is a volatile-qualified facet.

[edit] Parameters loc - the locale object to query [edit] Return value

Returns true if the facet Facet was installed in the locale loc, false otherwise.

[edit] Notes

std::has_facet must return true for all locales loc if Facet is one of the standard facets given here.

[edit] Example

Output:

Can loc classify chars? true
Can loc classify char32_t? false
Does loc implement myfacet? true
[edit] Defect reports

The following behavior-changing defect reports were applied retroactively to previously published C++ standards.

DR Applied to Behavior as published Correct behavior LWG 436 C++98 it was unclear whether Facet can be cv-qualified it can be const-qualified, but not volatile-qualified [edit] See also set of polymorphic facets that encapsulate cultural differences
(class) [edit] obtains a facet from a locale
(function template) [edit]

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4