-x means (0-x) or means (-1*x)
because I want to overload operators,
which one is necessary to overload if i would like to make -x understanable for the compiler?
I have a user defined type: real
and I have operator overloading:
real operator+(real x1, real x2);
I also have constructor real(double)
and casting defined double() in my real class.
Now (double + real) or (real + double)
is understanable for the compiler?
than the compiler makes double -> real first and add real + real
or makes real -> double first and add double + double?
If not, I have to make the following operator overloding also?:
real operator+(real x1, double x2);
real operator+(double x1, double x2);