home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / lang / cplus / 11697 < prev    next >
Encoding:
Internet Message Format  |  1992-07-28  |  1.5 KB

  1. Xref: sparky comp.lang.c++:11697 comp.std.c++:982
  2. Newsgroups: comp.lang.c++,comp.std.c++
  3. Path: sparky!uunet!usc!sdd.hp.com!mips!mips!rtech!ingres!bobm
  4. From: bobm@Ingres.COM (Bob McQueer)
  5. Subject: Re: Language extensions for run-time type identification
  6. Message-ID: <1992Jul28.233654.3466@pony.Ingres.COM>
  7. References: <BryFLI.Hz2@world.std.com>
  8. Date: 28 Jul 92 23:36:54 GMT
  9. Lines: 19
  10.  
  11. In <l7b2krINN10u@exodus.Eng.Sun.COM>,
  12.     dated 28 Jul 1992 17:57:47 GMT,
  13.     chased@rbbb.Eng.Sun.COM (David Chase) writes:
  14. > >... when I want to know at run time if
  15. > >an object is of a particular class, what I really want to ask is "is it this
  16. > >class, or any class derived from it?", which implies somebody taking the
  17. > >vtable (enhanced into class descriptor) pointer in the ...
  18. > Do be careful not to confuse the desired meaning of "X is a Foo" with
  19. > how it is actually implemented.  For single inheritance, the best
  20. > implementation is probably not what you think it is . ...
  21.  
  22. Point taken.  You are correct.  However, the question I want to ask still
  23. stands, and a simple comparison of my vtable pointer with the pointer for
  24. a given class isn't sufficient, which was the point I really wanted to make.
  25. There possibly are more efficient ways to do it than to ascend through the
  26. tree to the original base class given any underlying implementation.  Again,
  27. this underscores the need to think through this within the language definition,
  28. rather than having everybody reimplement it in their favorite ad-hoc manner.
  29.