libstdc++/4083: input stream with field width() set reads too much to std::string

bkoz@gcc.gnu.org bkoz@gcc.gnu.org
Fri Aug 24 12:07:00 GMT 2001


Synopsis: input stream with field width()  set reads too much to std::string

Responsible-Changed-From-To: unassigned->bkoz
Responsible-Changed-By: bkoz
Responsible-Changed-When: Fri Aug 24 12:07:52 2001
Responsible-Changed-Why:
    Mine.
State-Changed-From-To: open->feedback
State-Changed-By: bkoz
State-Changed-When: Fri Aug 24 12:07:52 2001
State-Changed-Why:
    This is not a bug. Both istream operators are working as expected:
    
    - 21.3.7.9 says that
    if is.width() is greater than 0, maximum number of appended chars is is.width, with characters extracted and appended until n characters are stored
    
    
    - 27.6.1.2.3 says that
    if is.width() is greater than 0, maximum number of appended chars is is.width, with characters extracted and appended until n-1 characters are stored
    
    Okay?

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=4083&database=gcc



More information about the Gcc-prs mailing list