Skip to content

Pointer Semantics and Weak Reference Design ​

Pointers are everywhere in C++, yet not every pointer owns the object it points to. A raw T* can be owning or non-owning, T& expresses a borrow but can never be null, and std::weak_ptr solves the weak-reference problem under shared ownership — but what if you don't manage your objects with shared_ptr? How is Chromium's WeakPtr designed? And why does T* + raw Flag* look like a WeakPtr while not actually being one?

In this series we hand-roll all kinds of non-owning pointer types from scratch, pinning down their semantic boundaries, safety conditions, and engineering trade-offs as we build.

Chapter Contents ​

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