Path: utzoo!attcan!uunet!samsung!usc!apple!amb From: amb@Apple.COM (A. Michael Burbidge) Newsgroups: comp.lang.c++ Subject: Re: Deriving new stream types: tstream Summary: non of the output operators in ostream are virtual! Message-ID: <48695@apple.Apple.COM> Date: 31 Jan 91 15:53:39 GMT References: Organization: Apple Computer Inc., Cupertino, CA Lines: 22 In article , jak@cs.brown.edu (Jak Kirman) writes: > I would like to create a type which behaves precisely as does an ostream > except that the constructor would take two ostream references, and every > operation would affect both ostreams equally. ... > > Clearly, in order to get the functionality of an ostream, I need to > inherit from ostream, but since an ostream has data, I can only contain > one ostream; I now have an assymetry between the two ostreams which are > being printed to: one is a base class and one is a member. Also, why > don't all the output functions defined on ostream resolve to calling a > single function, like "put"? That surely would have made inheriting > from ostream much simpler. The ostream class is practically useless as a base class since all of the output operators are non-virtual. I have asked on this newsgroup before why aren't the output operators virtual? I received no answers. Mike Burbidge Apple Computer, Inc. the output operators virtual. I got no answers.