Title
Application of LWG 436 accidentally deleted definition of "facet"
Status
c++17
Section
[locale.facet]
Submitter
Tim Song

Created on 2016-04-15.00:00:00 last changed 81 months ago

Messages

Date: 2016-08-06.20:44:18

Proposed resolution:

This wording is relative to N4582.

  1. Insert the following paragraph before [locale.facet]/1:

    -?- Class facet is the base class for locale feature sets. A class is a facet if it is publicly derived from another facet, or if it is a class derived from locale::facet and containing a publicly accessible declaration as follows: [Footnote: This is a complete list of requirements; there are no other requirements. Thus, a facet class need not have a public copy constructor, assignment, default constructor, destructor, etc.]

    static ::std::locale::id id;
    

    -1- Template parameters in this Clause which are required to be facets are those named Facet in declarations. A program that passes a type that is not a facet, or a type that refers to a volatile-qualified facet, as an (explicit or deduced) template parameter to a locale function expecting a facet, is ill-formed. A const-qualified facet is a valid template argument to any locale function that expects a Facet template parameter.

Date: 2016-08-03.00:00:00

[ 2016-08-03 Chicago ]

Fri AM: Moved to Tentatively Ready

Date: 2016-04-15.00:00:00

[locale.facet]/1 (then-called [lib.locale.facet]) read in C++03:

Class facet is the base class for locale feature sets. A class is a facet if it is publicly derived from another facet, or if it is a class derived from locale::facet and containing a publicly-accessible declaration as follows: [Footnote: This is a complete list of requirements; there are no other requirements. Thus, a facet class need not have a public copy constructor, assignment, default constructor, destructor, etc.]

static ::std::locale::id id;

Template parameters in this clause which are required to be facets are those named Facet in declarations. A program that passes a type that is not a facet, as an (explicit or deduced) template parameter to a locale function expecting a facet, is ill-formed.

LWG 436's intent appears to be to ban volatile-qualified facets and permitting const-qualified ones. The PR was somewhat poorly worded, however, and the editor in applying it deleted the whole first half of the paragraph, including the definition of facet and the requirement for a static data member named id.

As a result, we have things like [locale.id]/2 and [locale.global.templates]/1 referring to the id member that's not defined anywhere in the working draft.

History
Date User Action Args
2017-07-30 20:15:43adminsetstatus: wp -> c++17
2016-11-14 03:59:28adminsetstatus: pending -> wp
2016-11-14 03:55:22adminsetstatus: ready -> pending
2016-08-06 20:44:18adminsetmessages: + msg8440
2016-08-06 20:44:18adminsetstatus: new -> ready
2016-05-06 21:18:53adminsetmessages: + msg8087
2016-04-15 00:00:00admincreate