Global state & init order

Magic statics, inline variables, constinit.

Magic statics make function-local statics thread-safe — the Meyers singleton becomes correct by default, and the static-initialization-order fiasco (SIOF) is dodged by construct-on-first-use.

Config& config() {
  static Config c = load();   // initialized once, thread-safe, on first use
  return c;
}

No change.

inline variables let globals live in headers with one definition — but dynamic initialization order across TUs is still unspecified; keep them constexpr where possible.

inline constexpr Limits default_limits{ .fds = 256, .mem = 1 << 20 };

constinit guarantees compile-time initialization for mutable globals: SIOF becomes impossible for anything so marked, with zero runtime cost.

constinit std::atomic<Logger*> g_logger{nullptr};   // no dynamic init, ever

No change; the ranking stands: constant > constinit > magic static > mutable global (avoid).

Stable; contracts can now state invariants that globals must satisfy, but initialization rules are untouched.

C++29direction · not adopted

Stable.

C++26 per the final working draft; C++29 rows are proposals and direction, not adopted features.