A quote from N4713:
Dynamic initialization of non-local variables V and W with static storage duration are ordered as follows:
If V and W have ordered initialization and V is defined before W within a single translation unit, the initialization of V is sequenced before the initialization of W.
Is there a similar paragraph for variables of thread storage duration? In the code below, is the initialization of V sequenced before the initialization of W?
thread_local int V = 1; thread_local int W = V; Updated:
I want to modify the code as follows:
thread_local string V; thread_local string W;