Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!magnus.ircc.ohio-state.edu!tut.cis.ohio-state.edu!ucbvax!dog.ee.lbl.gov!ux5.lbl.gov!beard From: beard@ux5.lbl.gov (Patrick C Beard) Newsgroups: comp.std.c++ Subject: Re: type/member tags (was Re: asking an object for its type) Message-ID: <10721@dog.ee.lbl.gov> Date: 7 Mar 91 07:47:36 GMT References: <27C2D973.3C1B@tct.uucp> <70877@microsoft.UUCP> Reply-To: beard@ux5 (Patrick C Beard) Organization: Berkeley Systems, Inc. Lines: 16 X-Local-Date: Wed, 6 Mar 91 23:47:36 PST The information about what class an object is can be easily obtained by using the pointer to the object's virtual function table as the class id, which whill always be unique for every class. This could be quite easy to add to the language and easy to implement. Class relationships would be easy to implement by putting a link field in the vtable which points to a class's super-class. I agree that using run-time type information is quite easy to abuse, but then so is multiple-inheritance. These are powerful tools, but we shouldn't be forced to live without them. -- // Patrick C. Beard, Software Engineer, Berkeley Systems, Inc. // "Heroes of technology." // beard@lbl.gov, d0346@applelink.apple.com (ATTN: Patrick)