Path: utzoo!attcan!uunet!snorkelwacker!apple!voder!procase!roger From: roger@procase.UUCP (Roger H. Scott) Newsgroups: comp.lang.c++ Subject: Re: Why is << in the class ostream not virtual? Message-ID: <198@c.procase.UUCP> Date: 15 Oct 90 20:13:31 GMT References: <45575@apple.Apple.COM> Reply-To: roger@procase.UUCP (Roger H. Scott) Organization: proCASE Corporation, Santa Clara, CA Lines: 12 In article <45575@apple.Apple.COM> amb@Apple.COM (A. Michael Burbidge) writes: >... I discovered that the << operators in ostream are not virtual. Why? Two reasons: first, because the creators of C++ made, IMHO, the wrong decision about the default binding of member functions - i.e., non-virtual is the default so you have to say *more* to get the (again, IMHO) normal virtual behavior; second, because the class designers had the gall to presume that you wouldn't want/need to redefine the implementation of this operation. It is probably too late to do anything about the first problem, but the second problem *is* under our (programmers') control. Do the right thing - make them virtual!