This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Problem with class operators.
- From: "Kristian Kratzenstein" <kristian dot kratzenstein at kielnet dot net>
- To: gcc-help at gcc dot gnu dot org
- Date: Mon, 25 Jul 2005 10:22:58 +0200
- Subject: Problem with class operators.
- References: <42E49A30.9060800@kangaroologic.com>
Hi All,
I've a problem with class operators. In this case (I try to cut this down)
my class, which holds a string.
I'm working on XCode.
bool CkString::operator == (char const* string);
CkString::operator char*();
Now I try :
b = (ckstring == pchar);
now I get an Error :
error : ISO C++ says that these are ambiguous, even the worst
conversation for the first is better than the worst conversation for the
second
note : candidate 1: bool CkString::operator==(const char*)
note : candidate 2: operator==(char*, char*) <built-in>
thanks for help,
Kristian
--------------------------------------------
Kristian Kratzenstein
Gettorf
Kristian.Kratzenstein@KielNET.net
--------------------------------------------