This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: libstdc++/5737: ostringstream::str() appends \0 character


Synopsis: ostringstream::str() appends \0 character

Responsible-Changed-From-To: unassigned->paolo
Responsible-Changed-By: paolo
Responsible-Changed-When: Wed Feb 20 11:00:22 2002
Responsible-Changed-Why:
    Analyzed
State-Changed-From-To: open->closed
State-Changed-By: paolo
State-Changed-When: Wed Feb 20 11:00:22 2002
State-Changed-Why:
    Not a bug.
    If you don't want '\0' simply don't output it with << ends!
    The semantics of the ends manipulator is exactly that of
    outputting a '\0', not that of "closing" in any sensible
    meaning (see, f.i., Josuttis, pp. 587, 612, 650).
    More generally, an user of the C++ string class is *never*
    required to deal with termination chars of any sort.
    The ends manipulator is really there only to deal with char*
    (i.e., "C") strings (see Josuttis, p. 649-650).
    Thanks for your report, Paolo.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5737


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]