This is the mail archive of the
libstdc++@sourceware.cygnus.com
mailing list for the libstdc++ project.
Re: streambuf/iostream weirdness (bug?)
- To: libstdc++ at sourceware dot cygnus dot com
- Subject: Re: streambuf/iostream weirdness (bug?)
- From: Brent Verner <brent at linux1 dot org>
- Date: Wed, 26 Apr 2000 22:35:09 -0400
- References: <20000425132101.B1053@hesketh.com>
on Tue, Apr 25, 2000 at 01:21:01PM -0400, Brent Verner typed aloud:
| Hi,
|
| I've ran into a problem with a little piece of code that I'm
| working on that subclasses std::streabuf and std::iostream to
| use C's write() on a file descriptor specified in its ctor.
| Anyway, this all works ok until I put an std::endl to the
| stream, then nothing else will be put to it. It is _very_
| possible that I've screwed up my code, but if one of the gurus
| on the list could examine the situation, I'd appreciate it. If
| I've committed some greivous oversight in my attempt, I'd
| appreciate being shown my error. (code is below)
I've found my error, and learned a bit more about all of this :)
my overflow() implementation was incorrect. it needed the following
signature:
virtual int_type overflow( int_type arg ){}
however, my usage of EOF w/in caused many warnings, but a
static_cast<int_type>EOF quietened the compiler.
Q: is using static_cast<> as mentioned above sane? or is there
a more appropriate EOF to use?
Thanks
Brent