Skip to content

NoDestructor: static lifetime management, learned 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 sits alongside OnceCallback, WeakPtr, and flat_map, rounding out the static-lifetime piece of vol9/chrome.

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

Full tutorial (full/)

Hands-on design guide (hands_on/)

For readers comfortable with templates and lifetime: motivation, interface, and implementation, usage boundaries and testing.

v0.10.0-6-gbcee94e · bcee94e · 2026-08-20