Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!oliveb!apple!rutgers!att!westmark!mole-end!mat From: mat@mole-end.UUCP (Mark A Terribile) Newsgroups: comp.lang.c++ Subject: Re: ptr to member function, even worse Summary: Hang on a little longer ... Message-ID: <168@mole-end.UUCP> Date: 6 May 89 03:45:15 GMT References: <937@garya.Solbourne.COM> Organization: mole-end--private system. admin: mole-end!newtnews Lines: 30 > OK, everyone has been real helpful ... we've [figured] out what g++ and > cfront are doing with address of virtual function references. But ... > Consider a function > dispatch(objp,fnp) > which has very little knowledge of its arguments. It knows the following: > objp is a pointer to a C++ object > fnp is a pointer to a member function for objp (possibly virtual) > In particular, dispatch has no knowledge of the base class for objp. > Anybody have other thoughts or answers for something that works today? > This is a major hangup for us, since we have user applications inserting > objects and callback functions in a dispatch table. Not today, but in a few weeks. The proper solution, which will unfortunately affect your users, is to represent the callback operation by a base class and to use Multiple Inheritance. Then your users derive their classes to be called back from the callback class, and use a virtual function derived from that class as the callback function. Like lots of other people, I'm looking forward to MI. -- (This man's opinions are his own.) From mole-end Mark Terribile