Please rotate your tablet to be horizontal.

You can dismiss this notice but please note that this experience has not been designed for mobile devices and so will be less than optimal

Back To Schedule

Class Template Argument Deduction

History, How to Use it, and How to Enable it for Your Classes

09:00 - 10:00 Friday 16th September 2022 MDT Aurora A / Online A
Intermediate
Templates & Metaprogramming

In C++17, a new feature "Class Template Argument Deduction" (CTAD for short) was added to the language.

In this talk, I will show the rationale for this feature, how you can use it in your code, explain how it works and give examples of how to enable it for your classes.
I'll answer questions like:
* Why did the committee add this feature to the language?
* Why "class template argument deduction"? Why not just "template argument deduction"?
* What is a deduction guide?
* What can be done in a deduction guide?
* How do I write my own deduction guides?
* What tools are there for debugging deduction guides?

I will also talk about enhancements since C++17, and possible future directions.

Marshall Clow

Marshall Clow

Marshall has been coding for 40+ years; he was the lead developer on libc++ for 10 years, and the chairman of the Library working group of the C++ standards committee for 5 years. These days, he spends his time looking at "interesting problems"