When Abstractions Fix Too Much - Towards Flexible Library Design
summary
Argues that policy-based library design turns fixed decisions (storage, dispatch, semantics) into interchangeable policies and shows a working proof in a real any_view implementation. Implements in-place storage, allocator and small-buffer policies, a unified dispatch via bridge/thunks, and external witness table value templates; composes capabilities with iface/compose into an existential type. Delivers concrete optimizations: single-dispatch upcast conversion instead of double indirection, const-conversion and iterator-witness separation, and practical consteval/ABI tradeoffs — the techniques compile and measurably remove dispatch overhead.
AI-written summary · about
chapters (9)
- 0:00Introduction
- 1:06Abstraction tension in libraries
- 8:58Type erasure techniques
- 14:43Dispatch fundamentals
- 21:52Storage policies trade-offs
- 33:15Witness tables and existentials
- 53:01Existential types in practice
- 1:03:23Optimizations in any view
- 1:23:07Closing thoughts
related talks
01h 35mRuntime Polymorphism: Back to the Basics
01h 02mAdvanced Levelization Techniques (part 2 of 3)
55mBreaking Dependencies: Type Erasure - The Implementation Details
01h 01mMaintainability and Refactoring Impact of Higher-Level Design Features
46mThe Right Kind of Abstraction
05mConcept Driven Design with Dependency Injection
01h 28mModern C++ Design reloaded
01h 08mRuntime Polymorphism: Back to the Basics
