This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: whats wrong with pointer to member function


>>>>> "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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]