Template Argument Deduction for Class Templates
This lesson will make you learn how to skip make_Type functions to construct a template object.
We'll cover the following...
Do you often use make_Type
functions to construct a templated object (like std::make_pair
)? With C++17 you can forget about (most of) them and just use a regular constructor.
C++17 has filled a gap in the deduction rules for templates. Now template deduction can occur for standard class templates and not just for functions. That also means that a lot of your code that uses make_Type
functions can now be removed.
For instance, to create an ...