Expressing Implementation Sameness and Similarity - Polymorphism in Modern C++
summary
Survey claims which mechanisms actually express sameness: concrete examples with templates, mixins and CRTP downcast pattern show zero‑runtime cost reuse; C++23’s deducing this demonstrates where type deduction breaks because it mixes interface and implementation; operator<=> appears as a built‑in mixin; allocator/deleter design around allocate_shared vs allocate_unique shows a real API mistake in standard practice. Tradeoffs discussed include compile versus runtime overhead, information loss from copy‑paste, lack of reflection, and which patterns succeed or fail in long‑lived code.
AI-written summary · about
chapters (12)
- 0:00Sameness in modern C++
- 10:36Interface vs implementation
- 13:21Traditional polymorphism
- 21:27Mixins for sameness
- 25:40Element-wise comparison
- 31:01C++23 deducing this
- 36:42Reference qualifiers
- 43:31Don't repeat yourself principle
- 49:18Customization points
- 53:12Dangers of C++20 concepts
- 56:23Other sameness mechanisms
- 56:45Q&A
related talks
01h 18mMeta Polymorphism
01h 01mUsing Modern C++ to Eliminate Virtual Functions
01h 01mC++ Design Patterns - The Most Common Misconceptions (2 of N)
01h 01mEmbracing PODs Safely Until They Die
01h 01mBreaking Dependencies - C++ Type Erasure - The Implementation Details
01h 37mExtending and Simplifying C++: Thoughts on Pattern Matching using `is` and `as`
48mBack to Basics: Cpp Value Semantics
01h 03mType Erasure - The Implementation Details
