Article View: gnu.g++.help
Article #177Passing pointer to member functions to member functions.
From: Dick Munroe
Date: Thu, 13 Aug 1992 18:07
Date: Thu, 13 Aug 1992 18:07
33 lines
1180 bytes
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.
Technical Details
Message-ID:
<1992Aug13.140704.4426@dmc.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!dmc.com!munroeShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!dmc.com!munroe From: munroe@dmc.com (Dick Munroe) Newsgroups: gnu.g++.help Subject: Passing pointer to member functions to member functions. Message-ID: <1992Aug13.140704.4426@dmc.com> Date: 13 Aug 92 14:07:04 EDT Organization: Doyle, Munroe Consultants, Inc., Hudson, MA Lines: 33