strange looking ambiguity with type cast
strange looking ambiguity with type cast
- Subject: strange looking ambiguity with type cast
- From: jean-françois gauthier <email@hidden>
- Date: Wed, 11 Feb 2004 15:19:10 -0500
(please point me to another list if this is not the right place to
discuss this) it seems to me the following should just compile:
class a
{
public :
a (int) ;
} ;
class b
{
public :
operator a (void) ;
operator int (void) ;
} ;
int main (int, char ** const)
{
b _b ;
(a) _b ;
}
but gcc complains:
error: call of overloaded `a(b&)' is ambiguous
error: candidates are: a::a(const a&)
error: a::a(int)
why? this compiles fine with cwpro and msdev. it compiles if i replace
(a) _b with _b. operator a ().
jean-frangois
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.