diff --git a/point.cpp b/point.cpp index 36c2c1c2..f510a5ce 100644 --- a/point.cpp +++ b/point.cpp @@ -178,6 +178,11 @@ util::operator* (const point &p, const vector &v) { return v * p; } +//----------------------------------------------------------------------------- +template +util::point +util::operator* (T a, const point &b) + { return b * a; } //----------------------------------------------------------------------------- @@ -201,6 +206,7 @@ template struct util::point; template std::ostream& util::operator<< (std::ostream &os, const util::point&); \ template util::point util::operator* (const point&, const vector&); \ template util::point util::operator* (const vector&, const point&); \ +template util::point util::operator* (T, const point&); #define INSTANTIATE(T) \ INSTANTIATE_S_T(1,T) \ diff --git a/point.hpp b/point.hpp index 7c304cae..f12be728 100644 --- a/point.hpp +++ b/point.hpp @@ -69,6 +69,7 @@ namespace util { // free maths operators template point operator* (const vector&, const point&); template point operator* (const point&, const vector&); + template point operator* (T, const point&); // iostream operators template