Possible Duplicate:
Operator Overloading in C++ as int + obj
Operator overloading c++-faq
I have a Point
object with this operator:
Point operator +(float other) const {
return Point(x + other, y + other, z + other);
}
I can perform addition like so:
point + 10
But I can't perform it in reverse order:
10 + point
Is there another operator I need to overload in order to provide this functionality?