This is the mail archive of the 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: C++ function pointers and automatic class refrences

On May 22, 2002, "Mason, Sam" <> wrote:

> First off, I'm not sure if this is a good place to send this message
> to.  So if you know somewhere better please tell me. . .

It is not.  The newsgroup comp.lang.c++ would probably be better.

> Well what I'm trying to do is get something like C function pointers
> but with a reference to an object included so I don't have to use
> static functions. e.g.

Consider using function objects, i.e., objects that define operator(),
so they can be used like functions even though they are not.  This
will require changing the interface of the function that takes a
pointer-to-function as argument such that it can accept such a
function object.

GCC used to support bound pointers to member functions (i.e., pointers
to functions along with references to objects), but I'm not sure they
have the type you want, and I'm not sure they're still supported.

Alexandre Oliva   Enjoy Guarana', see
Red Hat GCC Developer                  aoliva@{,}
CS PhD student at IC-Unicamp        oliva@{,}
Free Software Evangelist                Professional serial bug killer

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