• 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: GoochRules! <email@hidden>
  • Date: Wed, 11 Feb 2004 14:35:02 -0700

On Feb 11, 2004, at 2:17 PM, jean-frangois gauthier wrote:

maybe i'm simply missing something, here. why is gcc trying to use a's constructor in the first place? aren't (a) _b and _b. operator a () strictly equivalent? is it possible that gcc might be confusing a (_b) and (a) _b?

jean-frangois

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:
    • Re: strange looking ambiguity with type cast
      • From: Shawn Erickson <email@hidden>
    • Re: strange looking ambiguity with type cast
      • From: jean-françois gauthier <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>)

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