This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: C++ function pointers and automatic class refrences
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: "Mason, Sam" <smason at mtc dot ricardo dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: 22 May 2002 20:24:29 -0300
- Subject: Re: C++ function pointers and automatic class refrences
- Organization: GCC Team, Red Hat
- References: <20020522085639.GA31976@mtc.ricardo.com>
On May 22, 2002, "Mason, Sam" <smason@mtc.ricardo.com> 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 http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist Professional serial bug killer