Skip to content

NoDestructor: static lifetime management lessons from Chromium ​

This directory takes apart Chromium's base::NoDestructor<T> and works through the lifetime management of global and static objects: why Chromium bans global constructors and destructors, how placement new manages lifetime by hand, the thread safety of magic statics, and the "intentional leak" tradeoff. It is the sister series to OnceCallback, WeakPtr, and flat_map, rounding out the static-lifetime piece of vol9/chrome.

NoDestructor is a lightweight component (a thin header-only wrapper class), so this series is leaner than the previous three.

Complete tutorial (full/) ​

Advanced design guide (hands_on/) ​

Aimed at readers with template and lifetime experience: motivation, API, and implementation, usage boundaries and testing.

pdf-latest-4-g85128cc · 85128cc · 2026-10-05