How can I define an operator for a class, which has a return value of another class? For example:
class 1: real
class 2: imag
addition between the two results in a third class: complex
division between two integers results in another class: fraction
Or even better, if it could return a variable of type variant<integer, fraction>, if the division gets evenly out it should return an integer.
Note: all classes in these examples are user defined.