From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE, MSGID_SHORT autolearn=no autolearn_force=no version=3.4.4 Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!princeton!allegra!alice!bs From: bs@alice.UUCP Newsgroups: comp.lang.ada Subject: Re: C++ as a way to use private types in C Message-ID: <6735@alice.uUCp> Date: Fri, 20-Mar-87 09:35:52 EST Article-I.D.: alice.6735 Posted: Fri Mar 20 09:35:52 1987 Date-Received: Sun, 22-Mar-87 15:43:24 EST References: <8703200117.AA10060@ucbvax.Berkeley.EDU> Organization: AT&T Bell Laboratories, Murray Hill NJ Summary: Multiple inheritance need not be expensive List-Id: In article <8703200117.AA10060@ucbvax.Berkeley.EDU>, WELTY@GE-CRD.ARPA.UUCP writes: > > >C++ is very similar to Ada, except for tasking where the older C-style > >facilities are used. > > C++ contains a number of serious differences, actually ... > > Objects in C++ (like objects in Flavors, CommonLoops, Smalltalk, etc.) > may be dynamically allocated and freed -- Ada Generics are a somewhat > weaker notion. Also, C++ provides single inheritance (unfortunately, > it does not support multiple inheritance; its designers feel that multiple > inheritance has unacceptable performance penalties). One of the ways C++ differs from Smalltalk and the object based Lisps is in efficiency (typically differences in low-level efficiency is measured in factors, not percents). To preserve this difference I avoid inherently slow features like the plague. However, multiple inheritance is not one of those. I have an experimental version of C++ with multiple inheritance. The added overhead in calling a member function is one memory reference plus one addition. The snag is that I'm still not fully convinced that multiple inheritance is a significant improvement over single inheritance. but I guess that this is not the right newsgroup for that question.