Modern Template Metaprogramming: A Compendium, Part I
summary
Demonstrates concrete template techniques and reproduces standard-library facilities: type traits like rank and remove_const, alias helpers (_t and _v), SFINAE via enable_if and conditional, and compile-time recursion for gcd and pow at compile time. Measures show the meta versions beat runtime pow for x^50 (historic tests report ~47% then ~90% improvement across optimizations). Introduces void_t as a practical new trait and shows how these tools are composed to build working, measurable compile-time components.
AI-written summary · about
chapters (11)
- 0:00Template metaprogramming intro
- 16:03Compile-time examples
- 23:53Recursion with meta functions
- 27:22Meta functions on types
- 30:14Standard library type meta functions
- 36:39Compile-time conditionals
- 42:25SFINAE explained
- 48:54Overloads with enable_if
- 51:08Concepts vs enable_if
- 53:46Value-returning meta functions
- 56:14Meta function syntax evolution
related talks
01h 06m“C++ Metaprogramming: Journey from simple to insanity and back"
01h 01mRethinking the Way We Do Templates in C++
57mIntroduction to C++ Template Metaprogramming
01h 01m“How bad is Meta-Programming still today?"
01h 37mRethinking the Way We Do Templates in C++ even more
01h 30mRethinking the Way We Do Templates in C++
51mC++: How I learned to stop worrying and love metaprogramming
01h 08mC++ Metaprogramming: A Paradigm Shift
