[net.lang.c++] Passing member functions

bs@alice.UUCP (07/18/86)

> Subject: Passing member functions to signal(2)
> From: muller@hplabsc.UUCP (Tom Muller)
> Organization: Hewlett-Packard Labs, Palo Alto, CA
>
> When a member function is passed to signal(2),
> the instance pointer, "this", is over-written
> with the signal number when it is called.
> 
> Has anyone found a way to circumvent this problem?

Signal(2) requires a pointer to a function, that is a pointer to a non-member
function. There is no excaping that. Don't pass it a member function.

In general: ``pointer to (non-member) function'' and ``pointer to function
member of class X'' are different types. Unfortunatly the typechecking in
release 1.0 fails to catch many errors in this area. Sorry. 1.1 does
significantly better.

A mechanism for fudging calls to member functions using pointers to functions
is described on pages 153-154 in the C++ book. I described the proper syntax
for and use of pointers to member functions here on net.lang.c++ earlier this
month.