Quantcast
Channel: What are the basic rules and idioms for operator overloading? - Stack Overflow
Viewing all articles
Browse latest Browse all 11

Answer by Sagar Rai for What are the basic rules and idioms for operator overloading?

$
0
0

Making it short and simple, I'll be referring to some points, which I had come over the past week as I was learning Python and C++, oops and other things, so it goes as follows:

  1. The Arity of the operator can not be modified further than to what it is!

  2. Overloaded operators can only have one default argument which the function call operator rest it cannot.

  3. Only built in operator can be overloaded, rest can't!

For more info, you can refer to the following link, which redirects you to the documentation provided by GeekforGeeks.

https://www.geeksforgeeks.org/g-fact-39/


Viewing all articles
Browse latest Browse all 11

Latest Images

Trending Articles



Latest Images