This page is a snapshot from the LWG issues list, see theLibrary Active Issues List for more information and the meaning ofCD1 status.
has_facet<Facet>(loc)Section: 28.3.3.1.2.1[locale.category]Status:CD1Submitter: Martin SeborOpened: 2001-09-18Last modified: 2016-01-28
Priority:Not Prioritized
View all otherissues in [locale.category].
View all issues withCD1 status.
Discussion:
It's unclear whether 22.1.1.1.1, p3 says thathas_facet<Facet>(loc) returns true for anyFacetfrom Table 51 or whether it includes Table 52 as well:
For any locale
loceither constructed, or returned bylocale::classic(), and any facetFacetthat is a member of astandard category,has_facet<Facet>(loc)is true. Eachlocale member function which takes alocale::categoryargument operates on the corresponding set of facets.
It seems that it comes down to which facets are considered to be members of astandard category. Intuitively, I would classify all the facets in Table 52 asmembers of their respective standard categories, but there are an unbounded setof them...
The paragraph implies that, for instance,has_facet<num_put<C,OutputIterator> >(loc) must always return true. I don't think that'spossible. If it were, thenuse_facet<num_put<C, OutputIterator>>(loc) would have to return a reference to a distinct object for eachvalid specialization ofnum_put<C, OutputIteratory>, which isclearly impossible.
On the other hand, if none of the facets in Table 52 is a member of a standardcategory then none of the locale member functions that operate on entirecategories of facets will work properly.
It seems that what p3 should mention that it's required (permitted?)to hold only for specializations ofFacet from Table 52 onC from the set {char,wchar_t }, andInputIterator andOutputIterator from the set of{{i,o}streambuf_iterator<{char,wchar_t}>}.
Proposed resolution:
In 28.3.3.1.2.1[locale.category], paragraph 3, change"that is a member of a standard category" to "shown in Table 51".
Rationale:
The facets in Table 52 are an unbounded set. Locales should not berequired to contain an infinite number of facets.
It's not necessary to talk about which values of InputIterator andOutputIterator must be supported. Table 51 already contains acomplete list of the ones we need.