Re: Compiler Error (Member Function Pointers)
Re: Compiler Error (Member Function Pointers)
- Subject: Re: Compiler Error (Member Function Pointers)
- From: Randy Croucher <email@hidden>
- Date: Fri, 7 Nov 2003 08:47:49 -0800
> I'm not 100% sure, but doesn't your passed-along function have to be a
> static function in order to allow it for being passed as a parameter ?
>
> here :
>
> class DerivedObject : public BaseObject
> {
> public:
> static const MyEntry m_entries[];
> void DoSomething(); // <<<<<-------------------- static ?
> };
No, because you can actually give the function "this" by calling it
like this:
void CallFunc( BaseObject *obj, MY_FUNC pfn )
{
(obj->*pfn)();
}
or...
void DerivedObject::CallFunc( MY_FUNC pfn )
{
(this->*pfn)();
}
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.