home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / cplus / 13182 < prev    next >
Encoding:
Internet Message Format  |  1992-09-01  |  1.2 KB

  1. Path: sparky!uunet!cs.utexas.edu!rutgers!cmcl2!acf5!checker
  2. From: checker@acf5.NYU.EDU (checker)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Callbacks - C++ needs an extension?
  5. Message-ID: <1897@acf5.NYU.EDU>
  6. Date: 2 Sep 92 05:25:31 GMT
  7. References: <DAVIDM.92Aug31105639@consilium.com> <la83j0INN839@appserv.Eng.Sun.COM>
  8. Organization: New York University
  9. Lines: 18
  10.  
  11. soloway@midniteoil.Eng.Sun.COM (Mark Soloway) writes:
  12. >This article describes a method I use to provide a convenient C++
  13. >callback interface for XView and provide the ability to encapsulate
  14. >callback behavior in a subclass.  The method described is used in
  15. >UIT V2.
  16. [explanation deleted]
  17.  
  18. The problem with this class of technique (I'll call them the casting
  19. techniques) is that the compiler can't do anything for you.  You are
  20. completely on you own to match the types of function and object
  21. pointers.  Even normally innocuous conversions (derived to base, etc.)
  22. become deadly and can't be tolerated by the code.  These conversions
  23. are hard to find because they may work properly with a single
  24. inheritance hierarchy but fail when multiple inheritance is added.
  25.  
  26. That isn't to say that I have a better solution, though.  :(
  27.  
  28. Chris
  29.