Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utcs!mnetor!seismo!gatech!cuae2!ihnp4!houxm!mhuxt!mhuxr!ulysses!allegra!alice!bs From: bs@alice.UUCP Newsgroups: net.lang.c++ Subject: Passing member functions Message-ID: <5808@alice.uUCp> Date: Thu, 17-Jul-86 21:19:39 EDT Article-I.D.: alice.5808 Posted: Thu Jul 17 21:19:39 1986 Date-Received: Fri, 18-Jul-86 23:55:30 EDT Organization: Bell Labs, Murray Hill Lines: 22 > 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.