Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!think.com!snorkelwacker!bloom-beacon!eru!hagbard!sunic!dkuug!iesd!iesd.auc.dk!amanda From: amanda@iesd.auc.dk (Per Abrahamsen) Newsgroups: comp.lang.c++ Subject: Re: Efficient compilation of virtual functions Message-ID: Date: 1 Sep 90 12:21:37 GMT References: <1990Aug22.193347.18486@ux1.cso.uiuc.edu> <6428@wolfen.cc.uow.oz> <7&`%1J-@rpi.edu> Sender: news@iesd.auc.dk (UseNet News) Organization: Games Research, University of Aalborg, Denmark Lines: 25 In-reply-to: adamsf@turing.cs.rpi.edu's message of 31 Aug 90 22:09:16 GMT >>>>> On 31 Aug 90 22:09:16 GMT, adamsf@turing.cs.rpi.edu (Frank Adams) said: amanda>It would be nice to be able to declare a class or even a member amanda>function as "leaf". Even if we disregard the possible optimizations, amanda>it would add to the programmers ability to document the classes. adamsf> I proposed exactly this about a year ago in this forum. The adamsf> only response I got was a note from Stroustrap, saying in adamsf> effect that he was unwilling to put (more) pure performance adamsf> hacks in the language. Does nobody else regard the ability to declare something as "leaf" as anything more than a performance hack? Or are performance hacks the only thing which really interest C++ programmers? I regard "leaf" to serve the same function as "private", "protected", and "const": They all provide valuable information to the person who is maintaining or (in the case of a class library) using the code. They also, as an extra bonus, sometimes allow the compiler to produce better code. On the down side, they also make it more difficult to do "unconstrained reuse" of existing code, as known from Smalltalk. They trade flexibility for reliability, and put a large burden upon the class designer.