Tests if a particular facet is stored in a specified locale.
const locale& _Loc
The locale to be tested for the presence of a facet.
true if the locale has the facet tested for; false if it does not.
The template function is useful for checking whether nonmandatory facets are listed in a locale before use_facet is called to avoid the exception that would be thrown if it were not present.
// compile with: /EHsc
using namespace std;
int main( )
locale loc ( "German_Germany" );
bool result = has_facet <ctype<char> > ( loc );
cout << result << endl;
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback