home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mcsun!sunic!hagbard!loglule!jbn
- From: jbn@lulea.trab.se (Johan Bengtsson)
- Newsgroups: comp.lang.c++
- Subject: Re: Just what is so great about streams?
- Message-ID: <5241@holden.lulea.trab.se>
- Date: 20 Nov 92 11:21:18 GMT
- References: <1992Nov19.131702.1@vax1.bham.ac.uk>
- Organization: Telia Research AB, Aurorum 6, 951 75 Lulea, Sweden
- Lines: 25
- X-Newsreader: Tin 1.1 PL4
-
- mccauleyba@vax1.bham.ac.uk (Brian McCauley) writes:
- : In article <1992Nov18.205139.12711@bcrka451.bnr.ca>, sjm@bcrki65.bnr.ca (Stuart MacMartin) writes:
- : >
- : > Perhaps I was thinking too general. If the class of fout does not need to
- : > redefine operator<<(), everything is ok. But if there is some processing
- : > that has to be done before the data is passed to the underlying stream,
- : > doesn't the class of fout have to redefine operator<<()? In which case
- : > my example does not work. Because operator<<() is *not* virtual. I don't
- : > think it is true that TimeStamp can properly write to *any* class that
- : > is ultimately derived from ostream. And if it can, I'd sure like to know how.
- :
- : Yes this is true. This is why classes derived from a stream class should
- : _not_ redifine operator<<. Different stream classes differ only in their
- : IO end not their data formatting end.
-
- Which means that stream subclasses are forever restricted to
- be simply forwarding classes to streambufs, right?
-
- Kind of shows that the design with separate ios and streambuf hierarchies
- is unnecessarily complicated, IMHO. Anyone care to comment?
- --
- --------------------------------------------------------------------------
- | Johan Bengtsson, Telia Research AB, Aurorum 6, S-951 75 Lulea, Sweden |
- | Johan.Bengtsson@lulea.trab.se; Voice:(+46)92075471; Fax:(+46)92075490 |
- --------------------------------------------------------------------------
-