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

  1. Xref: sparky comp.lang.c++:11743 comp.std.c++:990
  2. Newsgroups: comp.lang.c++,comp.std.c++
  3. Path: sparky!uunet!ftpbox!motsrd!news
  4. From: shang@corp.mot.com (David (Lujun) Shang)
  5. Subject: Re: Downcasting and mortal sin (was run-time type checking)
  6. Message-ID: <1992Jul29.164343.21959@cadsun.corp.mot.com>
  7. Sender: news@cadsun.corp.mot.com
  8. Reply-To: shang@corp.mot.com
  9. Organization: Motorola, Inc., Software Research and Development, Rolling Meadows, IL. 60008
  10. References: <2A75806A.826A@tct.com>
  11. Date: Wed, 29 Jul 92 16:43:43 GMT
  12. Lines: 17
  13.  
  14. In article <2A75806A.826A@tct.com> chip@tct.com (Chip Salzenberg) writes:
  15.  
  16. > Therefore you need this:
  17. >     virtual boolean Animal::can_mate_with(const Animal&);
  18.  
  19. I'm interested in the implementation of your "can_mate_with" in a derived  
  20. class. Whould you show me how it is done without RTTI?  Two conventions:
  21.  
  22. (1) Do not supply your own RTTI through virtual functions.
  23. (2) Do not flood virtual functions in the base for each possible derived  
  24. classes.
  25.  
  26. Okay?
  27.  
  28. David Shang
  29.