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]

Re: libstdc++/3593: Overloading streambuf for ostream doesn't appear to work




The sample program in this bug report made assumptions about the
representational value of underlying constants.  The streambuf::overflow()
member function must return traits_type::eof() to failure, and the arbitrary
value returned in the example just happens to map to traits_type::eof().

When the return value of the streambuf::overflow() member function is changed
from "return 0;" to "return traits_type::not_eof(c);", the sample program works
as expected.

This is not a bug in the application code and not in the library.  The PR
should be closed.

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

-------
Stephen M. Webb


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