Member function using pointer to member function

Volker Boerchers boercher@physik.uni-bremen.de
Mon Sep 14 10:24:00 GMT 1998


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





More information about the Gcc mailing list