325. Misleading text in moneypunct<>::do_grouping

Section: 25.4.6.3.2 [locale.moneypunct.virtuals] Status: CD1 Submitter: Martin Sebor Opened: 2001-07-02 Last modified: 2016-02-10

Priority: Not Prioritized

View all other issues in [locale.moneypunct.virtuals].

View all issues with CD1 status.

Discussion:

The Returns clause in 22.2.6.3.2, p3 says about moneypunct<charT>::do_grouping()

Returns: A pattern defined identically as the result of numpunct<charT>::do_grouping().241)

Footnote 241 then reads

This is most commonly the value "\003" (not "3").

The returns clause seems to imply that the two member functions must return an identical value which in reality may or may not be true, since the facets are usually implemented in terms of struct std::lconv and return the value of the grouping and mon_grouping, respectively. The footnote also implies that the member function of the moneypunct facet (rather than the overridden virtual functions in moneypunct_byname) most commonly return "\003", which contradicts the C standard which specifies the value of "" for the (most common) C locale.

Proposed resolution:

Replace the text in Returns clause in 22.2.6.3.2, p3 with the following:

Returns: A pattern defined identically as, but not necessarily equal to, the result of numpunct<charT>::do_grouping().241)

and replace the text in Footnote 241 with the following:

To specify grouping by 3s the value is "\003", not "3".

Rationale:

The fundamental problem is that the description of the locale facet virtuals serves two purposes: describing the behavior of the base class, and describing the meaning of and constraints on the behavior in arbitrary derived classes. The new wording makes that separation a little bit clearer. The footnote (which is nonnormative) is not supposed to say what the grouping is in the "C" locale or in any other locale. It is just a reminder that the values are interpreted as small integers, not ASCII characters.