template<class T>
inline Vector<T> &operator +=(Vector<T> &lhs, const Vector<T> &rhs) {
- lhs = lhs + rhs;
- return lhs;
+ return lhs = lhs + rhs;
}
template<class T>
inline Point<T> &operator +=(Point<T> &lhs, const Vector<T> &rhs) {
- lhs = lhs + rhs;
- return lhs;
+ return lhs = lhs + rhs;
}
template<class T>
return Point<T>(lhs.X() - rhs.X(), lhs.Y() - rhs.Y());
}
+template<class T>
+inline Vector<T> &operator -=(Vector<T> &lhs, const Vector<T> &rhs) {
+ return lhs = lhs - rhs;
+}
+template<class T>
+inline Point<T> &operator -=(Point<T> &lhs, const Vector<T> &rhs) {
+ return lhs = lhs - rhs;
+}
+
template<class T>
inline Vector<T> operator -(const Vector<T> &v) {
return Vector<T>(-v.X(), -v.Y());