Title
nonsensical ctype::do_widen() requirement
Status
cd1
Section
[locale.ctype.virtuals]
Submitter
Martin Sebor

Created on 2002-09-06.00:00:00 last changed 164 months ago

Messages

Date: 2010-10-21.18:28:33

Rationale:

The LWG believes this is just a typo, and that this is the correct fix.

Date: 2010-10-21.18:28:33

[ Kona: Minor edit. Added a comma after the M for clarity. ]

Date: 2010-10-21.18:28:33

Proposed resolution:

Replace the last sentence of [locale.ctype.virtuals], p11 with the following text:

       For any named ctype category with a ctype<char> facet ctc
       and valid ctype_base::mask value M,
       (ctc.is(M, c) || !is(M, do_widen(c))) is true.
Date: 2002-09-06.00:00:00

The last sentence in 22.2.1.1.2, p11 below doesn't seem to make sense.

  charT do_widen (char c) const;

  -11- Effects: Applies the simplest reasonable transformation from
       a char value or sequence of char values to the corresponding
       charT value or values. The only characters for which unique
       transformations are required are those in the basic source
       character set (2.2). For any named ctype category with a
       ctype<charT> facet ctw and valid ctype_base::mask value
       M (is(M, c) || !ctw.is(M, do_widen(c))) is true.

Shouldn't the last sentence instead read

       For any named ctype category with a ctype<char> facet ctc
       and valid ctype_base::mask value M
       (ctc.is(M, c) || !is(M, do_widen(c))) is true.

I.e., if the narrow character c is not a member of a class of characters then neither is the widened form of c. (To paraphrase footnote 224.)

History
Date User Action Args
2010-10-21 18:28:33adminsetmessages: + msg2413
2010-10-21 18:28:33adminsetmessages: + msg2412
2010-10-21 18:28:33adminsetmessages: + msg2411
2002-09-06 00:00:00admincreate