streambuf/iostream weirdness (bug?)

Brent Verner brent@linux1.org
Wed Apr 26 19:35:00 GMT 2000


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



More information about the Libstdc++ mailing list