“Modern C++ Design (part 1 of 2)”
summary
Argues that the real atom of C++ API design is the overload set and that copy vs move should be treated as that overload set (move as an optimization of copy), gives concrete rules for parameter passing: prefer const T& for unknowns, overload const T& and T&& when move cost matters, pass by value when the function work dwarfs a move, warns against equals-delete to enforce lifetimes, promotes string_view/span (and type-erased AnySpan) for non-owning parameters, and shows ref-qualified methods express maybe move or “call once” semantics.
AI-written summary · about
chapters (12)
- 0:00Introduction to API design
- 3:00The overload set
- 5:23Overload set guidelines
- 12:22Copy and move semantics
- 16:48Deleting overload members
- 20:18Overloading for move-only
- 22:17Parameter passing techniques
- 29:43Non-owning reference types
- 37:11The danger of dangling views
- 39:05Method qualifiers
- 43:43Const and thread safety
- 46:44Q&A and conclusion
related talks
44mPartially-formed Objects for fun and profit
01h 00mDesign Idioms from an Alternate Universe
53mTo Move or not to Move
01h 05mThe Imperatives Must Go!
01h 02mUsing Modern C++ to Revive an Old Design
58mApplied Modern C++: The problem of messages versioning in API
01h 01mBack to Basics: Designing Classes (part 1 of 2)
57mDesign Patterns - The Most Common Misconceptions (2 of N)
