Say I have an int
, like this:
int foo = 5;
I could then do this:
int bar = -foo; // -5
I want to be able to do the same with my class, so how do I overload the -
operator, used as * -1
? Do I have to overload the *
operator to do so?