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