This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: whats wrong with pointer to member function
- From: Momchil Velikov <velco at fadata dot bg>
- To: Bhattiprolu Ravikumar-A18658 <ravikb at motorola dot com>
- Cc: "'Matthias Oltmanns'" <Mathias dot Oltmanns dot Oltmanns at sysde dot eads dot net>,gcc-help at gcc dot gnu dot org
- Date: 07 May 2003 11:41:55 +0300
- Subject: Re: whats wrong with pointer to member function
- References: <653138C25D8AD6118292000347080A37770363@zin05exm02.corp.mot.com>
>>>>> "Bhattiprolu" == Bhattiprolu Ravikumar-A18658 <ravikb@motorola.com> writes:
Bhattiprolu> Hi Matthias,
Bhattiprolu> To my knowledge, in C++ to use function pointer to a member function,
Bhattiprolu> the member function has to be static member function. Try making foo as static.
No.
It's a simple operatoir precedence problem, instead of
``pA->*member();'' write ``(pA->*member)();'', likewise instead of
``a.*member();'' write ``(a.*member)()''.
~velco