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

  1. Xref: sparky comp.lang.c++:11817 comp.std.c++:999
  2. Newsgroups: comp.lang.c++,comp.std.c++
  3. Path: sparky!uunet!sybus.sybus.com!myrddin!tct!chip
  4. From: chip@tct.com (Chip Salzenberg)
  5. Subject: Re: Downcasting and mortal sin (was run-time type checking)
  6. Message-ID: <2A784613.34A4@tct.com>
  7. Date: Thu, 30 Jul 1992 19:42:11 GMT
  8. References: <2A75806A.826A@tct.com> <1992Jul29.164343.21959@cadsun.corp.mot.com>
  9. Organization: TC Telemanagement, Clearwater, FL
  10. Lines: 23
  11.  
  12. According to shang@corp.mot.com:
  13. >In article <2A75806A.826A@tct.com> chip@tct.com (Chip Salzenberg) writes:
  14. >> virtual boolean Animal::can_mate_with(const Animal&);
  15. >
  16. >I'm interested in the implementation of your "can_mate_with" in a derived  
  17. >class. Whould you show me how it is done without RTTI?
  18.  
  19. Of course.
  20.  
  21. >(1) Do not supply your own RTTI through virtual functions.
  22. >(2) Do not flood virtual functions in the base for each possible derived  
  23. >    classes.
  24.  
  25. Ah, so you already know how it can be done.
  26.  
  27. >Okay?
  28.  
  29. No, not okay.  I do not program with one hand tied behind my back.
  30. The complete language is always at my disposal.
  31. -- 
  32. Chip Salzenberg at Teltronics/TCT  <chip@tct.com>, <73717.366@compuserve.com>
  33.    "Do Rush place weird subliminal backmasked messages in their songs to
  34.  compel unwilling geeks to commit evil .sig atrocities?"  -- Dean Engelhardt
  35.