3 ms·
I suppose that this is needed if you want to guarantee that all the constructors that are executed before main() are executed in a certain order. I have not se
by adrian_b 3y ago
I suppose that this is needed if you want to guarantee that all the constructors that are executed before main() are executed in a certain order.
I have not searched the latest versions of the C++ standard to see if anything has changed, but in the older versions of C++ it was impossible to ensure that the global constructors will be executed in a certain order (to be able to satisfy dependencies between them).
For static variables that only have initial values taken from the executable file, without initialization code, I assume that something like this is not necessary.
- pjmlp 3y agoStill the same in regards to C++.