Re: Is there a pattern for creating an object with global scope?
Re: Is there a pattern for creating an object with global scope?
- Subject: Re: Is there a pattern for creating an object with global scope?
- From: Scott Ribe <email@hidden>
- Date: Sun, 14 Apr 2013 07:11:35 -0600
On Apr 13, 2013, at 9:51 PM, Jens Alfke wrote:
> C++ static initializers are evil, though, at least the ones that run code. They run super early, in an undefined order, with no way to specify dependencies between them; so if you’re not careful they can slow down launch and/or cause weird nondeterministic bugs.
They're not evil if you don't create dependencies ;-) Also, if you keep the number of such globals very low (I'm thinking < 10), you avoid most problems.
--
Scott Ribe
email@hidden
http://www.elevated-dev.com/
(303) 722-0567 voice
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden