This is the mail archive of the libstdc++@sourceware.cygnus.com mailing list for the libstdc++ project.


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

Re: streambuf/iostream weirdness (bug?)


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


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