C++ Design Patterns - The Most Common Misconceptions (2 of N)
summary
States which common claims are wrong and why: std::variant is not a drop‑in replacement for virtual functions (it gives a closed set of types and different architecture), explicit object parameters can replace CRTP only when the base is used via the derived type, and CRTP splits into static interface versus mixin uses. Shows concrete examples (visitor/strategy/factory), explains when design changes break extensibility, and presents benchmark results where variant outperforms virtual dispatch for the shown scenario. Choose this if you want precise distinctions, examples, and measured tradeoffs.
AI-written summary · about
chapters (19)
- 0:00C++ design patterns intro
- 1:12Talk overview and CRTP
- 3:00CRTP with inheritance
- 7:39CRTP limitations
- 9:25CRTP vs explicit params
- 12:30Static interfaces vs mixins
- 16:45CRTP forms terminology
- 20:21Concepts vs CRTP
- 24:36std::variant patterns
- 30:17Architecture separation
- 32:13GoF critique and virtual functions
- 34:39Modernizing with std::variant
- 40:00Performance comparison
- 42:50Architecture failures
- 47:14Why templates aren't a silver bullet solution
- 48:17std::variant vs virtual
- 51:09Dependency structures
- 52:34Architecture for large codebases
- 53:15Q&A
related talks
49mA Journey Into Non-Virtual Polymorphism in C++
59mThe Many Variants of std::variant
48mBack to Basics: Cpp Value Semantics
01h 01mUsing Modern C++ to Eliminate Virtual Functions
59mstd variant and the power of pattern matching
01h 05mExpressing Implementation Sameness and Similarity - Polymorphism in Modern C++
01h 01mBack to Basics: C++ API Design
59mFunctional Programming: data
