Title
volations of unformatted input function requirements
Status
nad
Section
[istream.unformatted]
Submitter
Martin Sebor

Created on 2003-01-05.00:00:00 last changed 172 months ago

Messages

Date: 2010-10-21.18:28:33

Rationale:

Not a defect. The standard is consistent, and the behavior required by the standard is unambiguous. Yes, it's theoretically possible for widen to throw. (Not that this will happen for the default ctype facet or for most real-world replacement ctype facets.) Users who define ctype facets that can throw, and who care about this behavior, can use alternative signatures that don't call widen.

Date: 2003-01-05.00:00:00

The Effects clauses for the two functions below violate the general requirements on unformatted input functions outlined in 27.6.1.3: they do not begin by constructing a sentry object. Instead, they begin by calling widen ('\n'), which may throw an exception. The exception is then allowed to propagate from the unformatted input function irrespective of the setting of exceptions().

Note that in light of 27.6.1.1, p3 and p4, the fact that the functions allow exceptions thrown from widen() to propagate may not strictly speaking be a defect (but the fact that the functions do not start by constructing a sentry object still is). However, since an exception thrown from ctype<charT> ::widen() during any other input operation (say, from within a call to num_get<charT>::get()) will be caught and cause badbit to be set, these two functions should not be treated differently for the sake of consistency.

History
Date User Action Args
2010-10-21 18:28:33adminsetmessages: + msg2488
2003-01-05 00:00:00admincreate