3 ms·
Wait, I think we are talking about two different things: the spec I pointed to refers to static local variables, and solves pretty much all the cases I can thin
by ot 15y ago
Wait, I think we are talking about two different things: the spec I pointed to refers to static local variables, and solves pretty much all the cases I can think of. (Initialization is delayed until first function call).
You are talking about global static variables, and yes, that's a tricky matter.
- barrkel 15y agoWell, being local doesn't protect you from indirect access; it's the lifetime that makes statics troublesome, not the scope. The function wrapping the local may be called by the initialization.