Discussing the article: "From Basic to Intermediate: Template and Typename (V)"

 

Check out the new article: From Basic to Intermediate: Template and Typename (V).

In this article, we'll explore one last simple use case for templates, and discuss the benefits and necessity of using typename in your code. Although this article may seem a bit complicated at first, it is important to understand it properly in order to use templates and typename later.

In the previous article, From Basic to Intermediate: Template and Typename (IV), I explained (as clearly and simply as possible) how we can create a template in order to generalize a type of modeling, effectively creating what can be considered a data type overload. However, at the end of that article, I introduced something that, for many readers, might have been quite difficult to grasp: the transfer of data into a function or procedure that is itself implemented as a template. Because that concept requires a more detailed explanation, I decided to dedicate this article to that topic. Moreover, there's another concept closely related to it: one that can make the difference between being able or unable to implement a given solution using templates.

So, to begin this article properly, let's start a new topic to explain why the last piece of code from the previous article actually works.


Author: CODE X