Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

YouTube

C++ Class Template Argument Deduction - History, Uses, and Enabling it for Classes - Lecture

CppCon via YouTube

Overview

Explore the history, uses, and implementation of C++ Class Template Argument Deduction (CTAD) in this comprehensive conference talk from CppCon 2022. Delve into the rationale behind CTAD's addition to C++17, learn how to effectively use it in your code, and discover techniques for enabling it in your classes. Gain insights into deduction guides, their functionality, and how to write and debug them. Examine enhancements made since C++17 and potential future developments. Benefit from Marshall Clow's extensive experience as he addresses key questions about CTAD, provides practical examples, and discusses tools for troubleshooting. Enhance your understanding of this powerful C++ feature and its impact on modern programming practices.

Syllabus

Intro
About Me
What is Class Template Argument Deduction
Class Template Argument Definition
Default Class Template Argument
Template Argument Deduction
Template Argument Deduction History
Class Template Argument Deduction
Why are you doing this
What does CTAD do
CTAD fills in the template arguments
CTAD makes make functions less necessary
How does it work
Deduction
Deduction Guide Example
How does this work
Its hard to understand
Definition of Vector
Constructors to Vector
Iterators
Template Parameters
Allocators
Values
Default Values
Compiler Time
Writing Deduction Guides for Classes
Compile Fail Tests
Add Deduction Guides
Existential Questions
assertSameType
assertSameType Example
SharedPointer Example
Can You Edit Deduction Guides
Shared Pointer
Implicit Deduction Guides
Alias Template Deduction Guides
Aggregate Template Deduction Guides
Inheritance of Deduction Guides
Summary
Misdeduction
Unreasonable Strings
Cons
Ambiguity
Questions

Taught by

CppCon

Reviews

Start your review of C++ Class Template Argument Deduction - History, Uses, and Enabling it for Classes - Lecture

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.