Templates Made Easy With C++20
summary
Argues that C++20 concepts plus if consteval and fold expressions let teams replace SFINAE-heavy template hacks with readable code, showing concrete rewrites: a constexpr Fibonacci, an In-Place Processor concept for audio buffers (process(span<float>)), a block processor using std::invocable to avoid std::function allocations, and a property system that uses a fold to register name/defaults with get_default_value overloads that pick value, function, or default-initialized. Live TDD builds an A/B processor with conditional reset and catches a common missing requires mistake.
AI-written summary · about
chapters (6)
- 0:00Introduction
- 10:10Traditional template basics
- 20:52C++20 concepts
- 31:47Advanced requires clauses
- 40:16Live coding with TDD
- 53:57Q&A
related talks
01h 35mC++20 – My Favourite Code Examples
01h 27mC++20 Templates - the Next Level: Concepts and More
01h 02mC++20 - My Favourite Code Examples
01h 03mBack to Basics: Templates (part 2 of 2)
57mIntroduction to C++ Template Metaprogramming
01h 00mConcepts in C++20: Revolution or Evolution
01h 30mRethinking the Way We Do Templates in C++
01h 06m“C++ Metaprogramming: Journey from simple to insanity and back"
