Re: Darwin: Weird call to structure constructor in formatter.h
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