[ODE] Re: Mac Stuff
Henry
henryj at paradise.net.nz
Tue Jul 23 00:27:01 2002
On Tuesday, July 23, 2002, at 09:51 AM, Ruud van Gaal wrote:
> As Nate explained, a member function is a pair: object pointer
> ('this') + function pointer. So this is intrinsically different from a
> single function ptr. Static member functions or static C/C++ functions
> are to be used here, since they don't have an object ptr. It's good to
> understand this; when compiling, C++ translates (simply put):
> obj->memberfunc(x,y)
>
> into
>
> memberfunc(obj,x,y)
>
> A void function would be:
> memberfunc(obj)
>
> Which is 2 pointers, not the 1 you can pass to callback functions. (and
> passing typeless member functions is bad practice, if doable at all).
I understand all that but other libs I use (eg lua) allow me to pass in
function pointers like this...
&theclass::theFunction
without having to worry about statics etc. I'll have to look into the
differences in the function declarations to see what's going on.
Henry