aboutsummaryrefslogtreecommitdiff
path: root/src/vector.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/vector.h')
-rw-r--r--src/vector.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/vector.h b/src/vector.h
index 5e105c4..839707f 100644
--- a/src/vector.h
+++ b/src/vector.h
@@ -53,6 +53,11 @@ Vector<T> operator*(T scalar, const Vector<T>& v) {
}
template <typename T, typename W>
+decltype(T{}*W{}) operator*(const Vector<T>& a, const Vector<W>& b) {
+ return a[0]*b[0] + a[1]*b[1];
+}
+
+template <typename T, typename W>
Vector<T> operator-(const Vector<T>& a, const Vector<W>& b) {
return Vector<T>{
a[0] - b[0],