This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Member function using pointer to member function
- To: Alexandre Oliva <oliva at dcc dot unicamp dot br>
- Subject: Re: Member function using pointer to member function
- From: Volker Boerchers <boercher at physik dot uni-bremen dot de>
- Date: Mon, 14 Sep 1998 15:40:40 +0200 (CEST)
- cc: egcs at cygnus dot com
On 14 Sep 1998, Alexandre Oliva wrote:
> > class A { double ff(double (A::*func)(double), double t); };
>
> > double A::fff(double t) { return ff(&f, t); }
>
> Spell it `(this->*ff)(&f,t);' and it will work.
>
Maybe i didn't understand but the replacement (in the definition of fff())
return ff(&f, t) -> return (this->*ff)(&f,t)
only leads to another error:
A.cc: In method `double A::ff(double (A::*)(double), double)':
A.cc:15: must use .* or ->* to call pointer-to-member function in `func
(...)'
A.cc: In method `double A::fff(double)':
A.cc:19: warning: assuming & on `A::ff(double (A::*)(double), double)'
A.cc:19: invalid use of `(null)' on pointer to member function
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Volker B"orchers, Uni Bremen, NW1, Raum 03160, Tel. +49-421-218-4522
mailto://boercher@physik.uni-bremen.de
http://hix.physik.uni-bremen.de/~boercher