This is the mail archive of the gcc-help@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]
Other format: [Raw text]

Problem with class operators.


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
--------------------------------------------



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