C++ Templates Revised
summary
Second edition updates cover 14 years and three major C++ versions and show concrete changes: use of auto return deduction and when it hides lifetime bugs (example: string_view concatenation UB from implicit conversions), new template tools (fold expressions to avoid recursive instantiation and speed compile times, NTTP with auto for string separators), generic lambdas plus deduction guides to build an overloaded visitor, constexpr extended for real compile‑time computation, and requires/concepts replacing many enable_if workarounds.
AI-written summary · about
chapters (21)
- 0:00Introduction
- 3:00Type trades
- 4:24Autotypes
- 5:41Return Types
- 9:42StringView
- 10:47StringView Problems
- 24:16Return Type Auto
- 26:43Template Overload
- 28:59Fold Expressions
- 35:04String Template Parameters
- 36:55Auto Template Parameters
- 39:09DecoType Auto
- 40:56Lambdas
- 42:32Function Objects
- 43:36Templates
- 45:17lambda
- 48:01function object
- 49:21deduction guides
- 50:59aggregates
- 52:06Context
- 53:49Prime Numbers
related talks
57mIntroduction to C++ Template Metaprogramming
01h 01mRethinking the Way We Do Templates in C++
58mC++17 in Practice - The good and the ugly
01h 27mC++20 Templates - the Next Level: Concepts and More
01h 21mWhat Has C++20 Ever Done For Templates?
50mExpression Templates: Past, Present, Future
01h 03mBack to Basics: Function and Class Templates
01h 30mRethinking the Way We Do Templates in C++
