Back to Basics: Templates in C++
summary
Covers concrete, up-to-date rules and examples: function and class templates, return-type deduction for mixed-type my_max, class template argument deduction for containers, non-type template parameters (std::array size), variadic templates with recursion vs compile-time if, and use of C++20 Concepts to resolve overloads (push_back vs insert) and produce clearer errors. Demonstrates what compiles, when templates instantiate, where code size or compile-time cost shows up, and which patterns actually work.
AI-written summary · about
chapters (13)
- 0:00Start
- 2:42Function Templates
- 6:40Template Instantiation
- 11:15Sprint Function
- 12:28Function Template
- 21:48Multiple Template Parameters
- 27:51Class Template
- 42:19Std Array
- 44:41Non-Type Template Parameter
- 47:20Print Function
- 49:44Lesson To Learn about Templates
- 50:43Compile Time
- 53:51Overload Resolution
related talks
59mBack to Basics: Generic Programming in C++
01h 07mBack to Basics: Templates (part 2 of 2)
59mModern Template Metaprogramming: A Compendium, Part II
54mModern Template Techniques
01h 02mC++20 Templates - the next level
01h 01mthe Concepts of concepts
41mTemplate meta-programming: Why you must get it
01h 07mVariadic and Variable Templates in C++14
