Back to Basics: The Rule of Five in C++
Talkat CppCon 2023 · on Friday, 2023-10-06· at 09:00· Maple 3/4/5, 6700 North Gaylord Rockies Boulevard·
summary
Explains the actual claim that if any special member needs work the others probably do too and demonstrates it by building a simple string class with raw pointer bugs then adding copy ctor, copy assign, move ctor, move assign and destructor so the fixes actually work and sanitizers stop screaming. Shows compiler behavior charts, uses unique_ptr and shared_ptr, explains when to use equals default and equals delete, and ends on preferring the rule of zero.
AI-written summary · about
chapters (14)
- 0:00Rule of Five intro
- 1:05C++ Core Guidelines
- 2:08C++ value-based object lifetime
- 4:36Rule of Five with string class
- 10:59Move semantics in C++11
- 15:34Formal Rule of Five
- 16:59Compiler special member functions
- 21:17Smart pointers for memory
- 24:51Copy/move challenges
- 27:17Rule of Five with smart pointers
- 28:00Rule of Zero intro
- 29:48Rule of Zero benefits
- 30:51Code design intent
- 32:54Closing & Q&A
related talks
01h 02mBack To Basics: The Special Member Functions
01h 03mBack to Basics: The C++ Core Guidelines
01h 40mBack to the Basics! Essentials of Modern C++ Style
01h 01mBack to Basics: C++ API Design
01h 30m50 shades of C++
49mBack to Basics: C++ Smart Pointers
58mUnderstanding and Mastering C++'s Complexity
01h 00mBack to Basics: Class Layout
