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: Volker Boerchers <boercher at physik dot uni-bremen dot de>
- Subject: Re: Member function using pointer to member function
- From: Alexandre Oliva <oliva at dcc dot unicamp dot br>
- Date: 14 Sep 1998 08:30:31 +-300
- Cc: egcs at cygnus dot com
- References: <Pine.LNX.3.96.980914125912.8493A-100000@hix.physik.uni-bremen.de>
Volker Boerchers <boercher@physik.uni-bremen.de> writes:
> the following code is accepted by gcc version 2.7.2.1:
gcc 2.7.2.1 was based on an old draft of the C++ standard, that
allowed the construct you're using (or maybe it accepted it as an
extension, I'm not sure)
> class A { double ff(double (A::*func)(double), double t); };
> double A::fff(double t) { return ff(&f, t); }
> 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
> (...)'
> Who is wrong; what can i do to make it work?
Spell it `(this->*ff)(&f,t);' and it will work.
--
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil