pghsteelers
Technical User
In learning C++ I have come across Overloading operators. At first I was thinking that it was strictly because you "can" manipulate the meaning for an operator so when it is used with a class you are actually calling a member function to perform some operation.
However, I have two question since learning about overloading operators:
1) what happens when you just use the operatore in your program expecting it to behave as the default representation? What happens when you want to use that operatore that you have overloaded with class objects and want to use it in as the default representation and not be calling a member function?
2) Is there any "must use" circumstances that you have to define a overload operator for a class or is it strictly for objective reasons?
Thanks in advance,
However, I have two question since learning about overloading operators:
1) what happens when you just use the operatore in your program expecting it to behave as the default representation? What happens when you want to use that operatore that you have overloaded with class objects and want to use it in as the default representation and not be calling a member function?
2) Is there any "must use" circumstances that you have to define a overload operator for a class or is it strictly for objective reasons?
Thanks in advance,