What Classes We Design and How
summary
Claim: design classes by role not by topic — map Value, Relationship, Manager to the special members to write or omit. Concrete tools and patterns: use optional to represent moved‑from state in a unique manager, follow Rule of Zero unless a destructor is needed, prefer deleted move/assign trick (the “rule of the mover”) to make polymorphic or scope managers non‑copyable, avoid empty destructor bodies, and implement move/copy exactly to transfer or duplicate the resource. Examples include scope guards, unique_ptr semantics, and general managers; patterns work as presented.
AI-written summary · about
chapters (17)
- 0:00Start
- 2:12Relation Semantics
- 2:42What Is a Value
- 9:47Dynamic Polymorphism with Virtual Member Functions
- 12:41Dynamic Polymorphism
- 14:50Technicalities of Relation Objects
- 19:23Unique Manager Types
- 19:59General Managers
- 24:29Unique Managers
- 31:24Define a Class
- 33:31Exceptions for Equals Default
- 38:12How Do We Prevent Copy Operations
- 42:27Polymorphic Base Class
- 43:47Manager Types
- 47:38Unique Manager
- 54:10General Manager
- 1:01:27How To Cope with Relation Objects
related talks
53mWhat Classes We Design and How
01h 06mThe Canonical Class
01h 01mC++ Design Patterns - The Most Common Misconceptions (2 of N)
51mBack to Basics: Master C++ Value Categories With Standard Tools
01h 05mExpressing Implementation Sameness and Similarity - Polymorphism in Modern C++
57mOo Considered Harmful
01h 18mMeta Polymorphism
53mCan C++ Data-oriented-design be Improved?
