Lightning Talk: Cute Approach for Polymorphism in C++
summary
Claims a concrete pattern: replace per-element virtual calls with one virtual call per vector by making the virtual method take a span of many elements, implement per-element work in a nonvirtual method, and provide a CRTP-style templated handler layer that iterates the span and calls the derived per-element routine. Compares to a Concepts+variant approach that forces recompiles, targets millions/billions of items, and reports restored bandwidth and encapsulation with minimal runtime overhead.
AI-written summary · about
chapters (5)
- 0:00Start
- 0:11The task
- 0:36Simplest solution: Inheritance
- 3:10A different approach: virtual on aggregation
- 4:19My approach
related talks
57mDesign Patterns - The Most Common Misconceptions (2 of N)
01h 07mDependency Injection Patterns: Efficiency and Usability
49mApplied Modern C++: beyond type erasure and visitor pattern
49mEnough TMP to write a Variant
05mLightning Talk: FlexClass - Classes With Dynamic Size For Everyone
57mHow to Design a Slimmer Vector of Variants in C++
41mEnough TMP to write a Variant
51mData Orientation For The Win!
