3 ms·
> That's a nice trick, but contrary to function statics, it is susceptible to SIOF. For those (like me) who don’t recognize that abbreviation, “The static init
by Someone 1y ago
> That's a nice trick, but contrary to function statics, it is susceptible to SIOF.
For those (like me) who don’t recognize that abbreviation, “The static initialization order fiasco (ISO C++ FAQ) refers to the ambiguity in the order that objects with static storage duration in different translation units are initialized in” (https://en.cppreference.com/w/cpp/language/siof.html https://en.cppreference.com/w/cpp/language/siof.html)
- ot 1y agoYes, thanks for the clarification, what I probably should have said is that the trick is basically syntactic sugar to declare a scoped global static variable, and as such it inherits all the problems of global static variables.