38. Facet definition incomplete

Section: 30.3.2 [locale.global.templates] Status: TC1 Submitter: Nathan Myers Opened: 1998-08-06 Last modified: 2016-01-28 10:19:27 UTC

Priority: Not Prioritized

View all issues with TC1 status.


It has been noticed by Esa Pulkkinen that the definition of "facet" is incomplete. In particular, a class derived from another facet, but which does not define a member id, cannot safely serve as the argument F to use_facet<F>(loc), because there is no guarantee that a reference to the facet instance stored in loc is safely convertible to F.

Proposed resolution:

In the definition of std::use_facet<>(), replace the text in paragraph 1 which reads:

Get a reference to a facet of a locale.


Requires: Facet is a facet class whose definition contains the public static member id as defined in [locale.facet].

[ Kona: strike as overspecification the text "(not inherits)" from the original resolution, which read "... whose definition contains (not inherits) the public static member id..." ]