filmov
tv
Back to Basics: Templates (part 1 of 2) - Andreas Fertig - CppCon 2020
![preview_player](https://i.ytimg.com/vi/VNJ4wiuxJM4/maxresdefault.jpg)
Показать описание
---
Template Basics
This talk is a two-parter. In the first part we start with the question what is generic programming. I then will introduce the different kinds of templates: function, class and method templates. We will walk through how to write and apply. Along with that we distinguish the different types of template parameters type, and non-type using std::array as an illustration. This is accompanied by a peak behind the scenes by using C++ Insights. This should also give you a valuable tool where you can checkout details for yourself.
At this point we look at alias templates and how they can help us.
Once we covered the basics, we take care that our templates do not bloat the code. For that we use an example of passing an array and a length and optimize this. While on that, we consider at type_traits and incorporate them in our solution. With type_traits we use constexpr if for conditional compile-time code paths.
This session is for developers with C++ experience who have avoided templates so far. After attending this talk, attendees have learned to think in types rather than in values and can write their own templates.
---
Andreas Fertig
Unique Code
Andreas Fertig is the CEO of Unique Code GmbH, which offers training and consulting for C++ specialized in embedded systems. He worked for Philips Medizin Systeme GmbH for ten years as a C++ software developer and architect focusing on embedded systems.
Andreas is involved in the C ++ standardization committee. He is a regular speaker at conferences internationally. Textbooks and articles by Andreas are available in German and English.
---
*-----*
*-----*
Комментарии