CompuServe Thread

ptrs to member functions

2 messages in this thread
#24375From: Chuck LeamonMar 6, 1990 6:47 AM
John, Thanks for the tips on pointers to member functions. I'll have to try them later today after other fires are put out. I don't have my Zortech Compiler Reference here, but I could swear I read a section dealing with pointers to member functions. I recall they took a totally different approched than BS. However, their example was using the function address outside of the class, where I'm trying to use it inside another member function. Why are member functions handled so differently from any other function? I could understand it if it were virtual or inline, since that address would be tough to resolve at runtime (then again I'm not a compiler writer). C h u c k
#24383From: John M. DlugoszMar 6, 1990 3:01 PM
There is nothing special about using a member pointer in another class. A parameter is a parameter, a variable is a variable. Zortech does not yet support member pointers. They decided to release it before it was finished, figuring not many would notice. It will be available some day. The address of a member function requires an object to be called. That is why it is different from other function pointers. It works just as well for virtual functions BTW. The syntax is a cross between function pointers and data member pointers. It is just what you would expect from uniform use of features. Your copy of BS might be pre-member pointer. –John