Type Deduction and Why You Care
summary
Covers how C++11/14 actually deduce types: three template-based patterns plus universal references and special rules for auto vs decltype(auto), lambda init‑captures and braced initializers. Demonstrates diagnostics: a TD trick that forces compiler error to show deduced types and runtime introspection using boost.typeindex. Calls out a real incompatibility (proposal N3922) that makes braced‑init behavior a breaking change on some compilers and explains the surprising const retention for by‑value lambda captures.
AI-written summary · about
chapters (13)
- 0:00Start
- 6:15The C++ Type Deduction Landscape
- 12:08Non-Ref Reference Pointer Parameters
- 13:28Non-URef Reference Pointer Parameters
- 16:44Yawn
- 17:04Universal References
- 21:25By-Value Parameters
- 29:29auto Type Deduction
- 38:25Lambda Capture Type Deduction
- 43:17Gratuitous Animal Photo
- 43:36Observing Deduced Types
- 52:32decltype Type Deduction
- 58:07Function Return Type Deduction
related talks
01h 03mC++ Class Template Argument Deduction - History, Uses, & Enabling it for Classes
01h 03mBack to Basics: Declarations in C++
01h 11mC++20 Templates: The next level: Concepts and more
49mThe Trouble With Types
54mA Tour of C++ Recognised User Type Categories
01h 05mBack to Basics: Lambdas
59mCute C++ Tricks, Part 2.5 of N - Code You Should Learn From & Never Write
57mTemplate Shenanigans
