home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / cplus / 12355 < prev    next >
Encoding:
Text File  |  1992-08-14  |  1.2 KB  |  29 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!munnari.oz.au!cs.mu.OZ.AU!mundil.cs.mu.OZ.AU!fjh
  3. From: fjh@mundil.cs.mu.OZ.AU (Fergus James HENDERSON)
  4. Subject: Re: Downcasting (was: Re: run-time type checking)
  5. Message-ID: <9222807.17387@mulga.cs.mu.OZ.AU>
  6. Keywords: polymorphism, RTTI, downcasts.
  7. Sender: news@cs.mu.OZ.AU
  8. Organization: Computer Science, University of Melbourne, Australia
  9. References: <1992Aug8.152913.20167@mole-end.matawan.nj.us> <1992Aug9.221309.15259@ucc.su.OZ.AU> <9222518.29381@mulga.cs.mu.OZ.AU> <1992Aug12.211716.7975@Warren.MENTORG.COM>
  10. Date: Fri, 14 Aug 1992 21:52:24 GMT
  11. Lines: 16
  12.  
  13. adk@Warren.MENTORG.COM (Ajay Kamdar) writes:
  14. >Making the Derived?* functions pure virtuals in the base class also
  15. >forces each derived class to know about its sibling classes. No good.
  16.  
  17. Yes, that would certainly be a bad idea; I think it was a typo in maxtal's
  18. original post.
  19. ie.    
  20.      virtual Derived *() = 0;
  21. should have been
  22.     virtual Derived *() { return 0; }
  23.  
  24. -- 
  25. Fergus Henderson             fjh@munta.cs.mu.OZ.AU      
  26. This .signature VIRUS is a self-referential statement that is true - but 
  27. you will only be able to consistently believe it if you copy it to your own
  28. .signature file!
  29.