Better HN
topnewbestaskshowjobs
Log inSign up

csegaults

-1 karma · joined Mar 8, 2026 (8mo ago) · 2 submissions

Submissions

comment 8mo ago · link · parent

Came here to say the same thing. Static is OK as long as the object has no dependencies but as soon as it does you're asking for trouble. Second the call_once approach. Another approach is an explicit initialization order system that ensures dependencies are set up in the right order, but that's more complex and only works for binaries you control.