Back to Basics: Function and Class Templates
summary
Covers concrete mechanics: writing function and class templates (swap, rational, bitset), how the compiler performs template instantiation versus an explicit specialization, when to use typename for dependent names, and how C++17 changes things (class template argument deduction and inline variables). Explains template parameter lists, non-type parameters, static data members and where to place definitions, template argument deduction limits (not from return types), and explicit instantiation with extern template for link-time control.
AI-written summary · about
chapters (11)
- 0:00Introduction and setup
- 1:54Function overloading vs templates
- 5:07Function template basics
- 17:26Class template introduction
- 27:40Member functions in class templates
- 33:26Template arguments and types
- 43:40Two-phase template translation
- 53:30Instantiation vs specialization
- 57:27Explicit instantiation
- 1:00:44Explicit specialization vs overloads
- 1:03:00Q&A and summary
related talks
57mIntroduction to C++ Template Metaprogramming
01h 03mBack to Basics: Compiling and Linking
01h 00mC++ Function Templates: How Do They Really Work?
01h 13mC++ Templates Revised
01h 30mRethinking the Way We Do Templates in C++
01h 27mC++20 Templates - the Next Level: Concepts and More
05mtemplate<template...>
01h 04mVariadic Templates in C++11 / C++14 - An Introduction
