+ 1
I haven't properly extrapolated about operator overloading guys!
There is this lesson that's too had to deduce. What is the purpose of the default constructor while overloading? In fact, how does the whole process work? https://code.sololearn.com/ca8ZGaXwVv4s/?ref=app
2 ответов
+ 2
John Wells thanks. That's giving me clue No1.
+ 1
The default constructor has no purpose in relation to operator overloaded. Your code could be modified so there is no default, instead of using it twice.
MyClass res = obj1+obj2;
is identical to this:
MyClass res = obj1.operator+(obj2);