C++20 Templates: The next level: Concepts and more
summary
Shows concrete, actionable detail: how requires expressions and a new concept keyword replace SFINAE patterns, examples that enforce same-type, noexcept and return-type constraints, and compile-time tests using static_assert. Demonstrates non-type template parameters with fixed_string (compile-time string NTTPs), templated lambdas with template heads, abbreviated function templates, and an assembly/Compiler Explorer peek to prove distinct manglings for +0.0 vs -0.0. Expects working code snippets and measurable improvements in diagnostics.
AI-written summary · about
chapters (28)
- 0:00Introduction
- 3:30German
- 4:25Concepts
- 7:08Motivation
- 8:36Createout
- 14:06Application areas
- 16:30Requirements
- 19:46Requires Expression
- 22:16Requirements Expression
- 22:52Simple Requirement
- 24:08Nested Requirement
- 25:53Compound Requirement
- 28:44Adhoc constraint
- 30:16Edible constraint
- 31:51Testing concepts
- 32:56Testing framework
- 34:00Function templates
- 36:10Auto
- 38:05Better error messages
- 42:46Type requirements
- 44:41Static assert
- 46:15Invalid type
- 47:17Template parameters
- 48:26Example in C
- 49:51Fixed String
- 50:59Fixed String Container
- 52:11Lambdas with Template Head
- 57:03Questions
related talks
01h 03mTemplates Made Easy with C++20
06mLightning Talk: C++20 - A New Way of Meta-Programming?
01h 04mC++ Concepts
07mLightning Talk: Higher-Order Template Metaprogramming with C++23
01h 01mBack to Basics: Concepts in C++
01h 05mGeneric Programming with Concepts Lite, Part II
01h 10mType Deduction and Why You Care
59mCute C++ Tricks, Part 2.5 of N - Code You Should Learn From & Never Write
