📖 Book · stl · high
📦 std::vector, from the inside
Size vs capacity, geometric growth, a from-scratch Vec<T>, and the noexcept-move payoff.
How std::vector really works: the size/capacity distinction, why push_back is amortised O(1) via geometric growth, a complete from-scratch growable array using raw storage + placement new, and the noexcept rule that decides whether reallocation moves or copies.
5 chapters▶ runnable code✦ in-depth animation
What this book covers
- 01“How does std::vector grow?”
- 02Capacity vs size — watch it reallocate
- 03Build a growable array from scratch — run it
- 04Why move semantics decide the cost of growth
- 05Invalidation & the gotchas
Read it in full — runnable C++ + step-through animations
Every chapter of std::vector, from the inside ships complete, editable code you compile and run in the browser, plus the same in-depth animations as the lessons.