Interfaces Matter
summary
Chronicles how C++ containers keep getting tugged between performance hacks and safe interfaces: shows why copy‑on‑write breaks in practice, why RVO/copy elision is fragile, and how noexcept for move lets implementations steal buffers instead of copying. Surveys allocator tricks and stack buffer hacks, explains the tradeoffs behind the small string optimization (≈4–22 bytes depending on build) and why ropes lose to threads, and demonstrates concrete alternatives like string_view/span and ranges for zero‑overhead borrowing.
AI-written summary · about
chapters (15)
- 0:00Introduction and speaker background
- 2:30Heap allocation in standard containers
- 5:49Copy on Write and its problems
- 7:57Compiler optimizations and RVO
- 10:31Expanded memory and custom allocators
- 14:33Move semantics and noexcept
- 18:25Thread safety vs rope strings
- 21:41Small string optimization
- 24:39Escaping standard container tyranny
- 25:43String view for safer interfaces
- 27:52Lifetime management with string view
- 28:55C-style functions with string view
- 31:24Span and ranges for complex data
- 32:49Future of container interfaces
- 34:01Conclusion and future vision
related talks
01h 23mThis is C++ - How to Use the C++ Superpower to Write Better C++ Code
01h 28mModern C++ Design reloaded
01h 11mI just wanted to point to something!
32mC++ Standard Library "Little Things”
58mOO Considered Harmful
39mTemporal Dynamics - Exploring the Intricacies of Object Lifetimes in Modern C++
52mAliasing in C++ - Risks, Opportunities and Techniques
55mBreaking Dependencies: Type Erasure - The Implementation Details
