Discussing the article: "From Basic to Intermediate: Operator Overloading (III)"

 

Check out the new article: From Basic to Intermediate: Operator Overloading (III).

In this article, we will examine how to implement overloading for both logical operators and comparison operators. This requires a certain amount of caution and a fair amount of attention. Even a minor oversight when implementing the overloading of these operators can render the entire code completely unusable. If any problems arise in the overloading, the entire database created from the results generated by the code will have to be either discarded completely or, at the very least, reviewed in full.

In the previous article, “From Basic to Intermediate: Operator Overloading (II)”, we examined how to create a debugging mechanism, as well as the risks associated with debugging code that uses operator overloading. Although that article may seem confusing and complicated at first, you, my dear reader, need to fully understand how this mechanism works. At some point, you may encounter difficulties debugging code that uses operator overloading. And without this knowledge, you won't be able to solve certain fairly complex problems correctly.

All right, although I've already introduced at least two operators that MQL5 allows you to overload, adapting these concepts to most of the other arithmetic operators shouldn't be a problem for you. However, there are other operators whose overloading mechanisms differ significantly. In some cases, they have some very specific characteristics.

So, it remains to explain how to overload logical operators—or, as many people call them, comparison operators—and that is exactly what this article will cover. So it's time to set aside anything that might distract you and focus on what's most important. To do this, we'll start a new topic.


Author: CODE X