Re: Controlling initialization order
Re: Controlling initialization order
- Subject: Re: Controlling initialization order
- From: "b.bum" <email@hidden>
- Date: Tue, 25 May 2004 10:05:39 -0700
On May 24, 2004, at 8:46 PM, David Catmull wrote:
How do I control the order in which global objects are initialized? In
CodeWarrior I can go to the Link Order tab and drag things around, but
I can't find a similar thing in XCode.
The initialization order of C++ objects is unspecified across
"translation units" (effective oversimplification: across source
files). That CodeWarrior (or other IDE/compiler/linkers) guaranteed
the order based upon link order is a feature that isn't within the
specification.
http://www.devx.com/getHelpOn/10MinuteSolution/17803/1954?pf=true
http://www.devx.com/getHelpOn/10MinuteSolution/17803
I liked this explanation:
http://users.utu.fi/~sisasa/oasis/cppfaq/ctors.html#[10.9]
http://users.utu.fi/~sisasa/oasis/cppfaq/ctors.html#[10.10]
The same holds true for ObjC and the +load and/or +initialize methods;
order is not guaranteed.
http://tinyurl.com/327ad
(Apple doc on +load)
b.bum
_______________________________________________
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.