Reusable C++ Code, Reusable C++ Data Structures
summary
Shows how a real layout algorithm called vertical center example gets reused for widgets and rectangular bitmaps by refactoring to a templated function that operates on ranges of rectangles, uses minimal Concepts, and prefers function overloads, output functions or callable customization over heavy inheritance. Explains sharing code+state via CRTP or templated base classes, avoids heap and refcounting with intrusive lists, and warns how easy std::variant misuse can grow into an accidental polymorphic design that should have been a runtime-polymorphic value type.
AI-written summary · about
chapters (13)
- 0:00Introduction
- 2:14Reusing algorithms
- 8:56Generic functions
- 10:42Customizing functions
- 14:33CRTP
- 21:34Runtime polymorphism
- 24:45Polymorphism in UI
- 31:12Intrusive containers
- 34:29Hiding polymorphism
- 38:26Design mistakes
- 41:36std::variant for reuse
- 44:31Right abstractions
- 45:14Q&A
related talks
01h 28mModern C++ Design reloaded
56mIdentifying Common Code Smells
01h 01mRethinking the Way We Do Templates in C++
45mPostmodern Programming
01h 25mLakos'20: The "Dam" Book is Done!
01h 02mAdvanced Levelization Techniques (part 2 of 3)
48mBack to Basics: Design Patterns
01h 23mRethink Polymorphism in C++
