inline Vector<T> operator +(const Vector<T> &lhs, const Vector<T> &rhs) {
return Vector<T>(lhs.X() + rhs.X(), lhs.Y() + rhs.Y());
}
+template<class T, class U>
+inline Vector<T> operator +(const Vector<T> &lhs, const Vector<U> &rhs) {
+ return Vector<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, class U>
+inline Vector<T> &operator +=(Vector<T> &lhs, const Vector<U> &rhs) {
+ return lhs = lhs + rhs;
+}
template<class T>
inline Vector<T> operator -(const Vector<T> &lhs, const Vector<T> &rhs) {
return Vector<T>(lhs.X() - rhs.X(), lhs.Y() - rhs.Y());
}
+template<class T, class U>
+inline Vector<T> operator -(const Vector<T> &lhs, const Vector<U> &rhs) {
+ return Vector<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, class U>
+inline Vector<T> &operator -=(Vector<T> &lhs, const Vector<U> &rhs) {
+ return lhs = lhs - rhs;
+}
template<class T>
inline Vector<T> operator -(const Vector<T> &v) {