У нас вы можете посмотреть бесплатно How to use FUNCTION TEMPLATES - a comprehensive guide for modern C++ или скачать в максимальном доступном качестве, видео которое было загружено на ютуб. Для загрузки выберите вариант из формы ниже:
Если кнопки скачивания не
загрузились
НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием видео, пожалуйста напишите в поддержку по адресу внизу
страницы.
Спасибо за использование сервиса ClipSaver.ru
Help me keep doing these videos! This works relies on your support! You can show it in one of these ways: 📚 Start a FREE Audible trial: https://www.audibletrial.com/CodeForY... 🛍️ Buy gear I use to make this video: https://github.com/cpp-for-yourself/s... 💶 Directly become a sponsor on GitHub: https://github.com/sponsors/niosus 📺 Watch my videos to the end and leave comments ⁉️ Find your way to support this work here: https://github.com/cpp-for-yourself/s... Writing function templates is part of the core skills we can use as a C++ programmer! Today, we cover close to everything there is to know about this topic skipping only very few cases that we leave for the future. Before you watch this video I recommend you to watch these videos if you haven't already: why use templates: • Why use templates in modern C++ what templates do under the hood: • Templates under the hood In this video we look at: How to write function templates What kinds of template parameters they accept How they can be specialized (and why they probably shouldn't) We cover a lot of ground in this video, and it is quite long as much as I tried to keep it very short. Please do not hesitate to comment and tell me what you think or what I might have missed. 📚 As always, the script to the video with all the code examples lives here: https://github.com/cpp-for-yourself/s... 00:00 - Start 02:53 - Type template parameters 03:31 - Non-type template parameters 04:47 - Multiple template parameters 05:31 - Implicit template parameters 07:50 - Multiple template parameters 09:13 - Mixing explicit and implicit template parameters 10:33 - Function template overloading 12:54 - Be careful with reference types 13:49 - Do not specialize function templates 15:48 - First example against function template specialization 17:37 - Dimov/Abrahams example against function template specialization 19:27 - Templates work at compile time 21:55 - Summary 22:53 - What next? 🔗 Some additional links: Template parameters: https://en.cppreference.com/w/cpp/lan... Template argument deduction: https://en.cppreference.com/w/cpp/lan... Why not specialize function templates: http://www.gotw.ca/publications/mill1... CppCoreGuidelines on why not specialize function templates: https://isocpp.github.io/CppCoreGuide... std::forward: https://en.cppreference.com/w/cpp/uti...