🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Dick Munroe Thu, 13 Aug 1992 18:07
Passing pointer to member functions to member functions.
#177
Author: Dick Munroe
Date: Thu, 13 Aug 1992 18:07
33 lines
1180 bytes
I thought I had an application for passing pointers to member functions to
other members.  Turns out it wasn't necessary, but I was UNABLE to get the
compiler to even THINK about letting me pass them in without introducing a
typedef.  The ARM isn't at all clear on this and my other reference books
didn't help either.

Is the typedef necessary?  If not, what would the correct syntax for the
following be without it?

class a ;

typedef void (a::*foo)() ;

class a 
{
public:
	void bar(foo) ;
} ;

void a::bar(foo function)
{ 
	(this -> *function)() ; 
} ;


Thanks for the help.
-- 
Dick Munroe				Internet: munroe@dmc.com
Doyle Munroe Consultants, Inc.		UUCP: ...uunet!thehulk!munroe
267 Cox St.				Office: (508) 568-1618
Hudson, Ma.				FAX: (508) 562-1133

GET CONNECTED!!! Send mail to info@dmc.com to find out about DMConnection.
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