Overview
Explore the intricacies of runtime polymorphism in C++ through this comprehensive ACCU 2018 conference talk by Louis Dionne. Delve into alternative designs beyond traditional inheritance-based approaches, examining their tradeoffs and characteristics. Learn about a policy-based approach that enables runtime polymorphism with various storage options, including stack-allocated, heap-allocated, shared, and reference semantics. Discover how to achieve fine-grained control over dispatch mechanisms, potentially outperforming classic virtual tables. Gain insights from real-world implementations in the Dyno library and walk away with a clear understanding of different runtime polymorphism implementations, their tradeoffs, and guidelines for choosing the most appropriate solution for your specific use case.
Syllabus
Introduction
Mumbling
Runtime Polymorphism
Variant Limitations
Relationship
Inheritance
Inheritance Problems
Reference Semantics
Heap Allocation
Null State
Ownership Questions
Algorithms
Intrusive
Conclusion
Pseudocode
Approach
Fat Pointer
Creating a Vtable
Creating a Library
Inline
Storage Policy
Magic DSL
Strengths
Small Buffer Optimization
Implementation
Changing Storage Policy
Using Buffers
Language Level Facility
No Allocation
Benchmark
Rough Guidelines
Value Semantics
Function View
Shared Remote Storage
Taught by
ACCU Conference