Path: utzoo!news-server.csri.toronto.edu!rpi!usc!cs.utexas.edu!sun-barr!newstop!exodus!rbbb.Eng.Sun.COM!chased From: chased@rbbb.Eng.Sun.COM (David Chase) Newsgroups: comp.std.c++ Subject: Re: Tags, typecodes, experience with these things. Message-ID: <9997@exodus.Eng.Sun.COM> Date: 18 Mar 91 20:39:55 GMT References: <1399@culhua.prg.ox.ac.uk> <27D3E544.619A@tct.uucp> <4338@lupine.NCD.COM> <1991Mar12.123811.13701@kodak.kodak.com> <9661@exodus.Eng.Sun.COM> <71305@microsoft.UUCP> Sender: news@exodus.Eng.Sun.COM Organization: Sun Microsystems, Mt. View, Ca. Lines: 23 In article <71305@microsoft.UUCP> jimad@microsoft.UUCP (Jim ADCOCK) writes: >In article <9661@exodus.Eng.Sun.COM> chased@rbbb.Eng.Sun.COM (David Chase) writes: >|I also think that the language system should support these features, >|but that is probably a religious argument. Certainly, if nifty >|features are confined to objects with vptrs the costs can be kept low. > >Help me out. The obvious implementations to me would be either to >store such information in a given vtable slot [slot "0" say] or >indirect via a vtable function that is always automatically defined >[for classes that support runtime type info.] Either approach would >seem to defeat the not-too-uncommon situation in C++ where two classes >can share a vtable in common. Or am I missing something? No, you're not missing anything. That's the technique I'd use. I wasn't aware that space consumed by a vtables was a big deal, except in those cases where the compilation-and-linking system produced many vtables for a single class (I've heard about that). How big do vtables usually get, how often can they be shared, and (given a one-per-class implementation) how much space does this sharing usually save? David Chase Sun