• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
strange looking ambiguity with type cast
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: strange looking ambiguity with type cast
      • From: GoochRules! <email@hidden>
  • Prev by Date: Re: Mac OS X Deployment Target setting
  • Next by Date: Frameworks/multiply-defined symbols
  • Previous by thread: #include’ing .cpp files in different folders
  • Next by thread: Re: strange looking ambiguity with type cast
  • Index(es):
    • Date
    • Thread