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

  1. Xref: sparky comp.lang.c++:11462 comp.std.c++:937
  2. Newsgroups: comp.lang.c++,comp.std.c++
  3. Path: sparky!uunet!mole-end!mat
  4. From: mat@uunet.uu.net!mole-end
  5. Subject: Re: Language extensions for run-time type identification
  6. Message-ID: <1992Jul23.183041.147@uunet.uu.net!mole-end>
  7. Organization: :
  8. References: <1992Jul21.094204.20100@mole-end> <1992Jul22.150330.6160@cadsun.corp.mot.com>
  9. Date: Thu, 23 Jul 1992 18:30:41 GMT
  10. Lines: 28
  11.  
  12. In article <1992Jul22.150330.6160@cadsun.corp.mot.com>, shang@corp.mot.com (David (Lujun) Shang) writes:
  13. > In article <1992Jul21.094204.20100@mole-end> mat@mole-end writes:
  14. > > 
  15. > > The assumption underlying the decision to include only classes with
  16. > > virtual functions is that a class that has no polymorphic behavior
  17. > > whatsoever (not even a virtual destructor) cannot be used in any way
  18. > > that is both safe and interesting even with the proposed runtime type
  19. > > support.  Can you refute this assumption?
  20. > > -- 
  21.  
  22.  
  23. > First of all and to be specific to C++, it is the class hierarchy, or  
  24. > inheritance and the polymorphic pointers that lead to the necessity of
  25. > run time type checking. It is not the virtual behaviors of a class.
  26. > We still need run time type check even if we disallow any virtual behaviors
  27. > in C++. Therefore, the assumption is laid on the wrong ground.
  28.  
  29. But without virtualization (polymorphic behavior) derivation is effectively
  30. useless.  There is no reason to code inheritance without providing for
  31. virtualization.  Then the case which you mention is of no use unless and
  32. until it is provided with RTTI; providing RTTI for it using reasonable
  33. and economical mechanisms would violate certain assumptions that C++ allows
  34. its users to make (C struct compatability).
  35. -- 
  36.  (This man's opinions are his own.)
  37.  From mole-end                Mark Terribile
  38.  
  39.  uunet!mole-end!mat, Somewhere in Matawan, NJ
  40.