Your New Mental Model of constexpr
summary
Claim: constexpr is best viewed as moving work from runtime to compile time along a constexpr continuum (0–100%). Tools and standards: C++20 features, CTRE, constexpr dynamic allocation, static constexpr and lambdas, Compiler Explorer to inspect output. Surprising numbers: demos shrink runtime assembly from ~160 to ~35 lines and move 40/60/80/100% of work to compile time. Built artifacts: a Commodore 64 slideshow rendered mostly at compile time and a constexpr ARM emulator that executes instructions at compile time; both work but require known compile-time inputs and careful memory/tradeoff choices.
AI-written summary · about
chapters (10)
- 0:00Introduction and definition
- 1:49Constexpr vs. metaprogramming
- 3:22Evolution of constexpr
- 7:29The constexpr continuum
- 11:03Practical implementation approach
- 15:06Case study: string and font processing
- 20:20Optimizing presentation logic
- 22:49System-wide constexpr integration
- 27:52Live coding demonstration
- 44:04Q&A and advanced discussion








