Ambiguous warning disablement?
Ambiguous warning disablement?
- Subject: Ambiguous warning disablement?
- From: "Theodore H. Smith" <email@hidden>
- Date: Thu, 26 May 2005 17:57:28 +0100
Well I've had good success so far in working around the showstoppers,
with the advice of the list members here.
I've just got a G5 with gcc 4.0.0.
I'm getting this:
"error: ISO C++ says that these are ambiguous, even though the worst
conversion for the first is better than the worst conversion for the
second"
And the error is with using the C++ string class's operator[int]. It
complains that this:
MyStringSubClass s = "fred;"
if (s[0] == 'f') {...
is actually confusable with using NSString's operator! MyStringSubClass
is subclassed off of "string". I actually have an operator that
converts the MyStringSubClass into an NSString*, so I can see where the
ambiguity could come from.
However, it seems to be able to disambiguate them properly, it says
that candidate1 is better than candidate2, and candidate1 is actually
the correct one.
So how do I get gcc to stop complaining and just compile my code? If
possible, I'd rather not remove the operator that converts my string
subclass into an NSString.
--
elfdata.com/plugin/ Industrial strength string processing, made easy.
"All things are logical. Putting free-will in the slot for premises in
a logical system, makes all of life both understandable, and free."
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden