Skip to content

WeakPtr: weak-pointer design lessons from Chromium ​

This directory implements a Chromium-style WeakPtr weak-pointer component and thoroughly unpacks a piece of modern C++ design: a pointer that never touches ownership, yet lets you safely observe whether the object is still alive. It is the sister series to the OnceCallback series — the industrial-grade answer to the hand-rolled cancellation token from 01-4 is WeakPtr.

Complete tutorial (full/) ​

Aimed at readers starting from zero: it opens with weak-reference concepts and prerequisite knowledge, then gradually leads up to a complete component implementation.

Prerequisites (7 articles):

Hands-on practice (6 articles):

Advanced design guide (hands_on/) ​

Aimed at readers who already have experience with C++ templates and concurrency: a fast-paced walkthrough of the design motivation, the implementation strategy, and the test verification:

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