Internal compiler error 40: pointer to member function syntax
Alexandre Oliva
oliva@dcc.unicamp.br
Thu Jan 8 12:26:00 GMT 1998
Phil Austin writes:
> gcc version egcs-2.90.21 971202 (egcs-1.00 release)
FYI, the error remains in egcs-1.0.1 :-(
> I would also be grateful if someone could
> tip me to the correct syntax to invoke a member function via a pointer
> to member function.
> useMethod(y,ts,dt);
> works in g++ 2.7.2.2 but not with egcs.
The correct syntax is: this->*useMethod(y,ts,dt);
Furthermore, you must write &ODEsolver::midpointODE, instead of
ODEsolver::midpointODE (note the & operator; it is not optional for
non-static member functions as it is for non-member functions)
--
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil
More information about the Gcc-bugs
mailing list