This page is a snapshot from the LWG issues list, see theLibrary Active Issues List for more information and the meaning ofTC1 status.
Section: 31.7.5.2.4[istream.sentry]Status:TC1Submitter: Nathan MyersOpened: 1998-08-06Last modified: 2021-06-06
Priority:Not Prioritized
View all otherissues in [istream.sentry].
View all issues withTC1 status.
Discussion:
In paragraph 6, the code in the example:
template <class charT, class traits = char_traits<charT> > basic_istream<charT,traits>::sentry( basic_istream<charT,traits>& is, bool noskipws = false) { ... int_type c; typedef ctype<charT> ctype_type; const ctype_type& ctype = use_facet<ctype_type>(is.getloc()); while ((c = is.rdbuf()->snextc()) != traits::eof()) { if (ctype.is(ctype.space,c)==0) { is.rdbuf()->sputbackc (c); break; } } ... }fails to demonstrate correct use of the facilities described. Inparticular, it fails to use traits operators, and specifies incorrectsemantics. (E.g. it specifies skipping over the first character in thesequence without examining it.)
Proposed resolution:
Remove the example above from [istream::sentry]paragraph 6.
Rationale:
The originally proposed replacement code for the example was notcorrect. The LWG tried in Kona and again in Tokyo to correct itwithout success. In Tokyo, an implementor reported that actual workingcode ran over one page in length and was quite complicated. The LWGdecided that it would be counter-productive to include such a lengthyexample, which might well still contain errors.