Path: utzoo!news-server.csri.toronto.edu!rutgers!usc!wuarchive!sdd.hp.com!elroy.jpl.nasa.gov!decwrl!infopiz!lupine!rfg From: rfg@NCD.COM (Ron Guilmette) Newsgroups: comp.std.c++ Subject: Re: type/member tags (was Re: asking an object for its type) Message-ID: <4328@lupine.NCD.COM> Date: 10 Mar 91 03:01:14 GMT References: <27C95D3A.1715@tct.uucp> <4201@lupine.NCD.COM> <27D270A7.2E3B@tct.uucp> Organization: Network Computing Devices, Inc., Mt. View, CA Lines: 26 Regarding using numeric codes for run-time type identifiers: In article <27D270A7.2E3B@tct.uucp> chip@tct.uucp (Chip Salzenberg) writes: > >Why not use the class name itself? One reason is that `class C' or `struct S' can have two or more meanings. Each of several compilations units may define its own `class C'. >>A much cleaner solution would have been to enlist the compiler & linker >>to assign the globally unique "type codes" up front, prior to run-time. >>This would have allowed us to avoid the (very expensive) table lookups >>which we did within the kernel for each transmitted message. > >A string lookup though a set of strings fixed at compile time needs to >be rewritten if it is "very expensive." You don't understand. If somebody charges you only $2.50 per ton of air, it is still "too expensive". Anything is "expensive" if you don't really need it. -- // Ron Guilmette - C++ Entomologist // Internet: rfg@ncd.com uucp: ...uunet!lupine!rfg // New motto: If it ain't broke, try using a bigger hammer.