C++ Weekly - Ep 38 - C++17's Class Template Argument Type Deduction

preview_player
Показать описание
☟☟ Awesome T-Shirts! Sponsors! Books! ☟☟

T-SHIRTS AVAILABLE!

WANT MORE JASON?

SUPPORT THE CHANNEL

GET INVOLVED

JASON'S BOOKS

► C++23 Best Practices

► C++ Best Practices

JASON'S PUZZLE BOOKS

► Object Lifetime Puzzlers Book 1

► Object Lifetime Puzzlers Book 2

► Object Lifetime Puzzlers Book 3

► Copy and Reference Puzzlers Book 1

► Copy and Reference Puzzlers Book 2

► Copy and Reference Puzzlers Book 3

► OpCode Puzzlers Book 1


RECOMMENDED BOOKS

AWESOME PROJECTS

O'Reilly VIDEOS

Рекомендации по теме
Комментарии
Автор

I've used std::make_tuple() numerous times, but didn't realize the reason why it was necessary was because template type deduction was explicitly not allowed for class constructors.

The standard proposal has a great summary for the motivation:
"Having to specify the template arguments adds nothing but complexity! If constructors could deduce their template arguments 'like we expect from other functions and methods, ' then the following vastly simpler and more intuitive code could have been used instead."

ADorschner
Автор

please add a link on this video to your other video on creating functions that use templates.

MaxGuides
Автор

I did not quite get this. Why would you use something like `return t3 == t4`? That is not a comparison of types, but a comparison of the actual tuple objects.

shushens
Автор

"class template" not "template class"

nikhillrao
Автор

Cool stuff, but ..., it's tyoo-pul, not tup-pel. Just remember quadruple, which has the same latin base. It is pronounced quad-ryoo-pul, not quad-rup-pel.

paultessier
join shbcf.ru