This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of Dup status.

163. Return of gcount() after a call to gcount

Section: [istream.unformatted] Status: Dup Submitter: Dietmar Kühl Opened: 1999-07-20 Last modified: 2016-12-23

Priority: Not Prioritized

View all other issues in [istream.unformatted].

View all issues with Dup status.

Duplicate of: 60


It is not clear which functions are to be considered unformatted input functions. As written, it seems that all functions in [istream.unformatted] are unformatted input functions. However, it does not really make much sense to construct a sentry object for gcount(), sync(), ... Also it is unclear what happens to the gcount() if eg. gcount(), putback(), unget(), or sync() is called: These functions don't extract characters, some of them even "unextract" a character. Should this still be reflected in gcount()? Of course, it could be read as if after a call to gcount() gcount() return 0 (the last unformatted input function, gcount(), didn't extract any character) and after a call to putback() gcount() returns -1 (the last unformatted input function putback() did "extract" back into the stream). Correspondingly for unget(). Is this what is intended? If so, this should be clarified. Otherwise, a corresponding clarification should be used.