"it invokes undefined behavior ... no guarantee these run" Your quote doesn't say "undefined behavior", it says "implementation-defined [whether it works or not]", it's a different thing. We've been doing exactly this, and didn't have any issues. The only tricky part is that the registry itself must be a function-local static, to avoid static init order fiasco.
↧