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

 

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

In this article, we will take a first step toward showing how to implement operator overloading for the index operator and the assignment operator, while striving to offer a practical and interesting approach for everyone. What we will see here is only part of what I still intend to show, and it is directly related to the overloading of these operators.

In the previous article, “From Basic to Intermediate: Operator Overloading (III)”, I explained and demonstrated how to act when implementing the overloading of logical and comparison operators is required. Despite the simplicity I strive to bring to my articles—so that everyone can understand how to create their own solutions—the topic of operator overloading remains one of the most confusing for beginner programmers. So, my dear reader, do not think you already know how to do everything just because you read the previous article. It is very important that you practice and analyze different situations in order to fully understand this topic.

Well, if logical operators and relational operators can already cause quite a bit of confusion and problems on their own, then what we'll look at here will prove even more complex. This is because we are going to look at another operator that can be overloaded. I am referring to the index operator, and since it is rarely used on its own, we will also look at the assignment operator. So, it is time to set aside anything that might distract you and focus on what we will be covering in this article. As some people like to say, now the fun really begins.


Author: CODE X