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

 

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

In this article, we will take a very close look at how to solve the problem posed at the end of the previous article. There was an attempt to create a template of such type so that to be able to create a template for data union.

In the previous article: “From Basic to Intermediate: Template and Typename (III)“, we started a topic that many newbies find particularly challenging. This is because many people have not understood a concept that is very important to MQL5 programmers: the concept of templates. Since I understand that many readers know very little about programming, I try to make the material as didactic as possible.

Therefore, we ended the previous article rather abruptly, it ended with an image of an error and a code that did not generate an executable file. I know that many people might be disappointed to see something like this in an article. However, I have just begun to introduce you to a topic that turns out to be quite difficult when you first get to know it: the topic of type overloading. In fact, what we are currently creating is not a type overload, but a template type that allows the compiler to generate the right type for each situation that we need to handle.

Since, in principle, any code that is provided in an article should work, we have made a small limitation in the explanation. But I am trying to explain it so that you understand that the code does not always work when we implement it. I know many people who want to learn how to solve problems in their code. However, the vast majority of them cannot solve problems simply because they do not have the right ideas about either this resource or this programming language. And without this it is difficult to explain how to solve certain types of tasks that are a trifle for professional programmers, but a big problem for a beginner.


Author: CODE X