From C++ Templates to C++ Concepts - Metaprogramming: an Amazing Journey
summary
Traces template metaprogramming from C++98 to C++20 and implements a working container detector first with SFINAE, tag dispatch, enable_if, void_t, declval and type_traits then with C++20 requires/Concepts. Shows exact code patterns (partial specialization, variadic templates, constexpr if, deduction guides), compares error messages, notes Concepts make the is_container predicate far shorter and more debuggable, reports compilation-time cost increases, and demonstrates that the C++20 concept version successfully replaces the long enable_if plumbing.
AI-written summary · about
chapters (25)
- 0:00Introduction
- 0:44Speaker background
- 1:40Template overview
- 2:50Function templates
- 4:30Overloading resolution
- 6:10Class templates
- 6:49Type traits
- 10:06Modern trait aliasing
- 11:13Tag dispatching
- 12:39Compile time branching
- 13:08Constrained auto
- 14:25Container detection
- 16:22Ellipsis usage
- 18:27Enable if
- 20:58C++17 container detection
- 21:34Variadic templates
- 23:17Void t
- 24:13Advanced container detection
- 31:42Metaprogramming challenges
- 32:37C++20 concepts
- 36:03Concept requirements
- 37:50Refining container concept
- 41:14Concept usage
- 43:40Conclusion
- 45:48Q&A








