This is the mail archive of the gcc@gcc.gnu.org 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]

Re: Member function using pointer to member function


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




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