Manuel wrote:[color=blue]
> Manuel wrote:
>[color=green]
>> W Marsh wrote:
>>[color=darkred]
>>> A member function pointer isn't at all the same as a normal function
>>> pointer. See the FAQ (there is an entire section on this topic):
>>>
http://www.parashift.com/c++-faq-lit...o-members.html[/color][/color]
>
>
> I'm reading...
> It seem it's legal:[/color]
What do you mean by "it"? Passing a member function pointer when a
top-level function pointer is expect simply won't compile, as you have
discovered. A static member function pointer /probably/ will. As the FAQ
says, a member function is meaningless without an object to invoke it on.
[color=blue]
>
> ---------------------------------------------------
>
> Because a member function is meaningless without an object to invoke it
> on, you can't do this directly (if The X Window System was rewritten in
> C++, it would probably pass references to objects around, not just
> pointers to functions; naturally the objects would embody the required
> function and probably a whole lot more).
>
> As a patch for existing software, use a top-level (non-member) function
> as a wrapper which takes an object obtained through some other
> technique. Depending on the routine you're calling, this "other
> technique" might be trivial or might require a little work on your part.
> The system call that starts a thread, for example, might require you to
> pass a function pointer along with a void*, so you can pass the object
> pointer in the void*. Many real-time operating systems do something
> similar for the function that starts a new task. Worst case you could
> store the object pointer in a global variable; this might be required
> for Unix signal handlers (but globals are, in general, undesired). In
> any case, the top-level function would call the desired member function
> on the object.
> ----------------------------------------------------
>
> I've correctly understand?
> thx,
>
> Manuel[/color]