Inference in C++: The big picture
summary
C++ evolves inference across standards (auto in C++11, generic lambdas C++14, CTAD in C++17, Concepts in C++20) and the claim is that using them together removes brittleness and lets code flip between runtime and compile-time dispatch with tiny edits (one added or removed auto). Concrete tools and examples: class template argument deduction and ranges::to let pipelines deduce correct container types; type_identity<T> disables unwanted deduction; prefer constrained auto to avoid silent breaks. One production case drops dozens of instructions to a single jump.
AI-written summary · about
chapters (13)
- 0:00Introduction
- 1:17Why generic programming
- 8:53Motivating examples
- 12:31History of inference
- 19:17C++20 concepts
- 25:01Type identity
- 28:23Big picture of inference
- 31:20First example revisited
- 36:32Limitations and reality
- 40:54Second example revisited
- 46:14Best practices
- 56:01Key takeaways
- 57:49Q&A
related talks
48mClass Template Argument Deduction: A New Abstraction
49mC++17 Features (part 1 of 2)
55mCustom Overload Sets and Inline SFINAE for Truly Generic Interfaces
54mC++ Concepts for Developers
52mConcepts: The Future of Generic Programming
01h 39m“Concepts: The Future of Generic Programming (the future is here)”
39mEverything You Always Wanted to Know About Type Inference
59mMetaprogramming: From Templates to Concepts
