• 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: Darwin: Weird call to structure constructor in formatter.h
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Darwin: Weird call to structure constructor in formatter.h


  • Subject: Re: Darwin: Weird call to structure constructor in formatter.h
  • From: David Dunham <email@hidden>
  • Date: Sun, 4 Feb 2007 10:04:57 -0800


On 4 Feb 2007, at 09:51, Daniel Stenning wrote:

I am puzzled by this line  in formatter.h   in OS/X  Darwin
 ( ie  BSD  Unix ) :

_M_parameters[_M_num_parameters++] = _Parameter(__value, __name);

Can anyone explain  WHY ?????


Here, _Parameter(__value, __name) - far as I can tell - is one of many
structure constructors, and thus should NOT return any value !!!

I'm not a C++ syntax expert, but I think you're misunderstanding what this does -- that's not a literal constructor call (as in this- >_Parameter()) but a class name used in object creation (which of course does call a constructor).


I know in our code we end up with stuff like

this->notify(String("foo"));

which makes a temporary String object and passes it to the notify method.

So presumably in the code you question a _Parameter is created and then operator= is called.


David Dunham A Sharp, LLC
Voice/Fax: 206 783 7404 http://a-sharp.com
"People seem to misinterpret complexity as sophistication" -- Niklaus Wirth



_______________________________________________ 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
References: 
 >Darwin: Weird call to structure constructor in formatter.h (From: Daniel Stenning <email@hidden>)

  • Prev by Date: Apple Bug Reporter - was Re: XCode dependency handling
  • Next by Date: Re: Darwin: Weird call to structure constructor in formatter.h
  • Previous by thread: Re: Darwin: Weird call to structure constructor in formatter.h
  • Next by thread: Token Concatation in Info.plist Files?
  • Index(es):
    • Date
    • Thread