3 ms·
That UB is so hard to see, even when you know about static initialization order indeterminism. Static initialization is such a bug magnet in general. Can make
by vardump 3y ago
That UB is so hard to see, even when you know about static initialization order indeterminism.
Static initialization is such a bug magnet in general. Can make builds ”work” randomly, when static object constructors are ran in more or less random order, decided by the compiler. Change something unrelated and kaboom.
(Needless to say, that statically initializing anything with a complex constructor is a bad idea, especially if it refers to another statically initialized object.)