• 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
Re: strange looking ambiguity with type cast
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: strange looking ambiguity with type cast


  • Subject: Re: strange looking ambiguity with type cast
  • From: jean-françois gauthier <email@hidden>
  • Date: Wed, 11 Feb 2004 17:13:19 -0500

a couple of points about this.

i dont think that the conversion method returns a reference; if it did, then calling _b. operator a () would fail to compile as well. moreover, commenting out the declaration for the other conversion operator (operator int ()), the code compiles fine. so im starting to think that its a bug in gcc. the reason im worrying about this at all is that id rather not modify loads of code just for xcode-gcc if im not sure why im doing it.

jean-frangois



Le 11 fivr. 2004, ` 16:35, GoochRules! a icrit :

I think what you're missing is that there's a unnamed temporary of type a created during (a) _b, because operator a() returns an a& by definition.
So, gcc isn't confusing a::a(b) with b::operator a(), it simply need to know whether to call b::operator a() or b::operator int() to pass to the appropriate constructor for a.
_______________________________________________
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:
    • Getting Started
      • From: "Barry Fawthrop" <email@hidden>
    • Re: strange looking ambiguity with type cast
      • From: GoochRules! <email@hidden>
References: 
 >strange looking ambiguity with type cast (From: jean-françois gauthier <email@hidden>)
 >Re: strange looking ambiguity with type cast (From: GoochRules! <email@hidden>)
 >Re: strange looking ambiguity with type cast (From: jean-françois gauthier <email@hidden>)
 >Re: strange looking ambiguity with type cast (From: GoochRules! <email@hidden>)

  • Prev by Date: java application targeting
  • Next by Date: Re: strange looking ambiguity with type cast
  • Previous by thread: Re: strange looking ambiguity with type cast
  • Next by thread: Re: strange looking ambiguity with type cast
  • Index(es):
    • Date
    • Thread