Slighty off-topic, why is he using ptrdiff_t (instead of size_t) for the cap & len types?
Skeeto and Stroustrup are a bit confused about valid index types. They prefer signed, which will lead to overflows on negative values, but have the advantage of using only half of the valid ranges, so there's more heap for the rest. Very confused
From one of his other blogposts. "Guidelines for computing sizes and subscripts"
https://nullprogram.com/blog/2024/05/24/https://www.youtube.com/watch?v=wvtFGa6XJDU