Order of Static Construction

Dru Dru at notreal.com
Fri Jan 4 13:27:29 UTC 2019


from the spec:
"Shared static constructors on all modules are run before any 
non-shared static constructors."

Is there a specific reason, or is it just for simplicity?

There could be a situation where a shared ctor depends on a 
thread local variable.
Preferably, the variable is only initialized in a non-shared ctor.




More information about the Digitalmars-d mailing list