3 ms·
Why does it need the D runtime to set a variable once? This seems very complicated.
by CyberDildonics 3y ago
Why does it need the D runtime to set a variable once? This seems very complicated.
- gavinray 3y agoTo be honest, I'm not entirely sure of the technical reason: https://forum.dlang.org/post/sgiyhdnpdyxvigwtrfqk@forum.dlang.org https://forum.dlang.org/post/sgiyhdnpdyxvigwtrfqk@forum.dlan...
- adrian_b 3y agoI 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++.