Template-less Metaprogramming in C++
summary
Claim: a template-less metaprogramming style generates and manipulates types using values not angle‑bracket recursion. Implementation is ~100 lines of C++17 that runs on GCC Clang and MSVC, using function-address IDs and friend injection to map values ↔ types. Examples: find_index, type_element, variant_for, packing structs and a sorted unique pass. Benchmarks against std::tuple, boost mp11 and Circle measure 100–1000 elements; Circle is fastest, MP is comparable or faster than mp11 and avoids heavy template recursion, so the approach actually works.
AI-written summary · about
chapters (11)
- 0:00Introduction
- 10:51C++ metaprogramming history
- 12:37Finding index in type list
- 16:54Value-based metaprogramming
- 24:02Variant type filtering
- 31:53Testing metaprogramming code
- 39:19Implementation overview
- 40:41C++26 metaprogramming
- 45:38Circle language metaprogramming
- 49:55Metaprogramming performance
- 58:30Summary
related talks
01h 03mTemplate Metaprogramming: Practical Application
06mLightning Talk: C++20 - A New Way of Meta-Programming?
07mLightning Talk: Higher-Order Template Metaprogramming with C++23
01h 03mTemplates Made Easy with C++20
01h 11mC++20 Templates: The next level: Concepts and more
59mCute C++ Tricks, Part 2.5 of N - Code You Should Learn From & Never Write
01h 10mType Deduction and Why You Care
01h 01mBack to Basics: Templates (part 1 of 2)
