Created on 2013-03-01.00:00:00 last changed 45 months ago
Proposed resolution:
This wording is relative to N4713.
Change [istream.unformatted] as shown:
basic_istream<charT, traits>& putback(char_type c);-34- Effects: Behaves as an unformatted input function (as described above), except that the function first clears eofbit. After constructing a sentry object, if !good() calls setstate(failbit) which may throw an exception, and return. If rdbuf() is not null, calls rdbuf()->sputbackc(c). If rdbuf() is null, or if sputbackc
-35- Returns: *this.()returns traits::eof(), calls setstate(badbit) (which may throw ios_base::failure ([iostate.flags])). [Note: This function extracts no characters, so the value returned by the next call to gcount() is 0. — end note]basic_istream<charT, traits>& unget();-36- Effects: Behaves as an unformatted input function (as described above), except that the function first clears eofbit. After constructing a sentry object, if !good() calls setstate(failbit) which may throw an exception, and return. If rdbuf() is not null, calls rdbuf()->sungetc(). If rdbuf() is null, or if sungetc
-37- Returns: *this.()returns traits::eof(), calls setstate(badbit) (which may throw ios_base::failure ([iostate.flags])). [Note: This function extracts no characters, so the value returned by the next call to gcount() is 0. — end note]
[ 2018-3-17 Adopted in Jacksonville ]
[ 2017-12-14 Moved to Tentatively Ready after 6 positive votes on c++std-lib. ]
[ 2017-12-12, Jonathan comments and provides wording ]
Fix the bogus expression, and change sputbackc() to just sputbackc since we're talking about the function, not an expression sputbackc() (which isn't a valid expression any more than rdbuf->sputbackc() is). Make the corresponding change to the equivalent wording in p36 too.
In [istream.unformatted] / 34, when describing putback, it says that "rdbuf->sputbackc()" is called. The problem are not the obvious typos in the expression, but the fact that it may lead to different interpretations, since nowhere is specified what the required argument to sputbackc is.
It can be guessed to be "rdbuf()->sputbackc(c)", but "rdbuf()->sputbackc(char_type())" or just anything would be as conforming (or non-conforming) as the first guess.History | |||
---|---|---|---|
Date | User | Action | Args |
2021-02-25 10:48:01 | admin | set | status: wp -> c++20 |
2018-03-18 16:03:30 | admin | set | messages: + msg9724 |
2018-03-18 16:03:30 | admin | set | status: voting -> wp |
2018-02-12 01:13:49 | admin | set | status: ready -> voting |
2017-12-14 04:09:16 | admin | set | messages: + msg9591 |
2017-12-14 04:09:16 | admin | set | status: new -> ready |
2017-12-13 18:31:35 | admin | set | messages: + msg9589 |
2017-12-13 18:31:35 | admin | set | messages: + msg9588 |
2013-03-01 00:00:00 | admin | create |