It's 2025, can we have a “lazy let”?

I was under the impression that dispatch_once relies on a static once token (memory that remained 0 since process start).

That‘s why static initializers are thread safe in Swift and lazy vars are not. It‘s just much more expensive to make instance member access thread safe.

1 Like