c++ static vs thread storage duration destruction order
问题 Consider how in c++ there are these two storage duration (among others): static storage duration and thread storage duration.. Next consider this code: static MyClassA a; thread_local static MyClassB b; Additional pretend that "a" and "b" might not be in the same compilation unit. I "believe" that the destructor of "b" will be called before "a" as the thread storage duration will terminate first and only after that is complete will the static storage duration terminate and call the destructor