How bad is meta-programming still today?
summary
Compares C++98/03, C++11 and C++14 with concrete examples: a compile‑time Fibonacci and prime checker, a one‑header C compiler that emits a binary array, and expression‑template vector sums that remove temporaries. Shows tools used—constexpr functions, enable_if, type_traits, static_assert—and practical limits: some Los Alamos projects compile for several days and get huge diagnostics (one error grew to 18 megabyte), constexpr can be forced by storing results in a constexpr variable, and template metaprogramming is Turing‑complete so it works but can be painfully slow to compile.
AI-written summary · about
chapters (11)
- 0:00Meta-programming history
- 3:55Early meta-programming hype
- 8:56Template meta-programming C++98
- 13:11C++11 vs C++14 compile-time
- 20:59Type traits and static assertions
- 24:58Expression templates tuning
- 31:49Compile-time optimizations use
- 36:48Loop unrolling optimizations
- 40:00Meta-programming Turing limits
- 45:46Compile-time computation limits
- 47:44Q&A
related talks
01h 04mWhat Can Compiler Benchmarks Reveal About Metaprogramming Implementation Strategies
23mFunctional Programming in C++ (Run time vs Compile time types)
41mTemplate meta-programming: Why you must get it
01h 09mFunctional Programming in C++
02h 02mPeering forward: C++'s next decade
59mModern Template Metaprogramming: A Compendium, Part II
05mLightning Talk: MP: Template Meta-Programming in C++
01h 02mC++20 - My Favorite Code Examples
