call of overloaded ambiguous
Jun 10, 2010 at 3:59pm UTC
I've got two member functions and g++ is giving me an ambiguous error. This just may be the way stadarg works.
1 2 3 4 5 6 7 8 9 10
SAS::send(char code, int level, char *m) {
}
SAS::send(char code, int level, char *fmt, ...) {
char buffer[1024];
//Do stuff
send(code, level, buffer); // THIS IS AMBIUGOUS!
}
Possibly there is no need to create 2 methods since stdarg will work with or
without arguments anyway?
Jun 10, 2010 at 4:34pm UTC
I think you're correct. Since the second method will take the same arguments as the first, there's no way for the compiler figure out which one you're talking about.
Jun 10, 2010 at 11:58pm UTC
Yes, the first function is not necessary.
Topic archived. No new replies allowed.