Thread View: net.lang.c++
1 messages
1 total messages
Started by bs
Fri, 18 Jul 1986 01:19
Passing member functions
Author: bs
Date: Fri, 18 Jul 1986 01:19
Date: Fri, 18 Jul 1986 01:19
22 lines
1446 bytes
1446 bytes
> 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.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads