Title
facet error reporting
Status
nad
Section
[locale.categories]
Submitter
Martin Sebor, Paolo Carlini

Created on 2006-06-22.00:00:00 last changed 172 months ago

Messages

Date: 2010-10-21.18:28:33

Proposed resolution:

We believe the intent is for all facet member functions that take an ios_base::iostate& argument to:

  • ignore the initial value of the err argument,
  • reset err to ios_base::goodbit prior to any further processing,
  • and set either ios_base::eofbit, or ios_base::failbit, or both in err, as appropriate, in response to reaching the end-of-file or on parse error, or both.

To that effect we propose to change 22.2, p2 as follows:

The put() members make no provision for error reporting. (Any failures of the OutputIterator argument must be extracted from the returned iterator.) Unless otherwise specified, the get() members that take an ios_base::iostate& argument whose value they ignore, but set to ios_base::failbit in case of a parse error., err, start by evaluating err = ios_base::goodbit, and may subsequently set err to either ios_base::eofbit, or ios_base::failbit, or ios_base::eofbit | ios_base::failbit in response to reaching the end-of-file or in case of a parse error, or both, respectively.

Date: 2010-10-21.18:28:33

[ 2009-07 Frankfurt ]

Move to NAD.

Date: 2006-06-22.00:00:00

Section 22.2, paragraph 2 requires facet get() members that take an ios_base::iostate& argument, err, to ignore the (initial) value of the argument, but to set it to ios_base::failbit in case of a parse error.

We believe there are a few minor problems with this blanket requirement in conjunction with the wording specific to each get() member function.

First, besides get() there are other member functions with a slightly different name (for example, get_date()). It's not completely clear that the intent of the paragraph is to include those as well, and at least one implementation has interpreted the requirement literally.

Second, the requirement to "set the argument to ios_base::failbit suggests that the functions are not permitted to set it to any other value (such as ios_base::eofbit, or even ios_base::eofbit | ios_base::failbit).

However, 22.2.2.1.2, p5 (Stage 3 of num_get parsing) and p6 (bool parsing) specifies that the do_get functions perform err |= ios_base::eofbit, which contradicts the earlier requirement to ignore err's initial value.

22.2.6.1.2, p1 (the Effects clause of the money_get facet's do_get member functions) also specifies that err's initial value be used to compute the final value by ORing it with either ios_base::failbit or withios_base::eofbit | ios_base::failbit.

History
Date User Action Args
2010-10-21 18:28:33adminsetmessages: + msg3141
2010-10-21 18:28:33adminsetmessages: + msg3140
2006-06-22 00:00:00admincreate