Policy-based design in C++20
summary
Policy-based design claims to replace runtime strategy objects with compile-time policy classes so a cable‑box example for DVB/DRM composes players, locks and protection without virtual tables. It uses templates, Boost.Hana style metafunctions, the detection idiom, concepts and simple type‑erasure via converting shared_ptr constructors to avoid boilerplate. The demo composes hybrid CAS+DRM protection by inheriting small policies, compiles when used and lets unused methods remain uninstantiated so errors only appear when invoked.
AI-written summary · about
chapters (8)
- 0:00Start
- 7:14Strategy pattern (example)
- 28:19Templates in C++ (meta functions)
- 40:56Strategies vs. Policies
- 45:40(Expression) SFINAE
- 49:37Detection idiom
- 54:00Concepts
- 59:58Type erasure
related talks
01h 03mWriting sustainable software. The how and the what!
05mLightning Talk: Is Polymorphism in C++ Really That Bad?
53mCan C++ Data-oriented-design be Improved?
01h 01mUsing Modern C++ to Eliminate Virtual Functions
01h 18mMeta Polymorphism
45mBoost Your Intra-Process Communication Programs With C++20 & Contract-Concept-Implementation Pattern
01h 05mExpressing Implementation Sameness and Similarity - Polymorphism in Modern C++
23mFunctional Programming in C++ (Run time vs Compile time types)
