This is the mail archive of the gcc@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]

Re: passing subclass methods as parameters


On Wednesday, August 22, 2001, at 08:40 PM, Brent Phillips wrote:
> ... the offensive line is
> RegisterHandler(mtype, 
> (MsgHandler)&(GsForwardThread::handle_SMsg_Ping)))

You might be getting bit by section 5.3.1 of the standard:
    &foo::bar   is a pointer-to-member, but
    &(foo::bar)   is not.
Further questions about the standard might better be
asked in the comp.std.c++ newsgroup.

> Any thoughts on what to try to get this to compile?  It seems every
> time I upgrade gcc, the method pointer parameter passing breaks...

Hmm, seems to me that this would discourage most programmers
from using pointers-to-members at all.  ("Doc, it hurts when
I do this...")

  -- Doug


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