This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
C++ compiling errors.
- To: egcs at cygnus dot com
- Subject: C++ compiling errors.
- From: TazQ <tazq at crazy dot ml dot org>
- Date: Sat, 27 Jun 1998 01:28:21 -0400 (EDT)
Hi, i'm not on this list, so plz direct replies to me.
I'm using egcs 1.0.3 on a linux 2.0.34 debian 2.0 (hamm) beta.
I get this annoying little error.
g++ -ggdb -Wall -c -DDEBUG -DVERSION=\"services0.8\" -DNOFORK infoserv.cc
infoserv.cc: In method `void InfoService::msgfrom(class aNick *, char *)':
infoserv.cc:97: must use .* or ->* to call pointer-to-member function in
`function (...)'
The error doesn't make sense given the code.
Function names and their pointers are put into a hash to call them.
typedef void (InfoService::*isfunc)(aNick *from, char *params);
The code
ISParse *blah = (ISParse *)ishash[what]; // Extract from hash
if(blah) { // If it's there
isfunc function = blah->func; // assign the function to a function pointer.
function(n, params); // Call function with current object.
}
This compiles fine under gcc2, and works perfectly.
Trying to figure out above error, I tried this->*function, this->function,
this.function, this.*function, and none of them compiled.
Please advise...
--- TazQ, God of Insanity, Co-Wielder of Doot, & Technical Director of
Twilight Dootistries.
Warning: This email is for informational purposes only. Do not ingest,
digest, reject, inject, deject, osmose or otherwise process this email.
If taken internally, seek psychiatric help immediately.