Enough TMP to write a Variant
summary
Claims a practical path from basic TMP to a working std::variant implementation that compiles under C++20 and fits less than 500 lines. Shows concrete tools: recursive union storage, index_sequence math, CTAD for a compile-time switch and macro-unrolled branches to get a jump table, plus multiple-dispatch handling, return-type deduction, noexcept and SFINAE. Demonstrates error-reporting via a no common type tag, discusses compile-time performance tradeoffs and asserts the implementation actually builds and debugs.
AI-written summary · about
chapters (12)
- 0:00Introduction
- 1:40What is Variant
- 3:50Library
- 7:22Integer List
- 8:22Type by Index
- 10:42Instance off
- 12:15Forward
- 13:45Union
- 18:37Switch
- 23:25Implementation
- 28:44Concept Friendly
- 33:32One Case
related talks
57mHow to Design a Slimmer Vector of Variants in C++
57mDesign Patterns - The Most Common Misconceptions (2 of N)
49mApplied Modern C++: beyond type erasure and visitor pattern
01h 00mMissing (and future?) C++ range concepts
01h 02mBreaking Dependencies - The Visitor Design Pattern in Cpp
01h 13mModernizing Finite State Machines in C++ - Empower Simplicity & Boost Performance With std::variant
58mApplied Modern C++: The problem of messages versioning in API
06mLightning Talk: Cute Approach for Polymorphism in C++
