From f97c6e9eb0ea8142864382e5d846617817d1ee77 Mon Sep 17 00:00:00 2001 From: Alan De Smet Date: Sat, 23 Mar 2019 11:34:12 -0500 Subject: [PATCH] Make operator* a member of struct size instead of being global --- src/main/cpp/tiv.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/cpp/tiv.cpp b/src/main/cpp/tiv.cpp index 092e4b2..ea66fb6 100644 --- a/src/main/cpp/tiv.cpp +++ b/src/main/cpp/tiv.cpp @@ -392,10 +392,10 @@ struct size { } unsigned int width; unsigned int height; + size operator*(double scale) { + return size(width*scale, height*scale); + } }; -size operator*(size lhs, double scale) { - return size(lhs.width*scale, lhs.height*scale); -} std::ostream& operator<<(std::ostream& stream, size sz) { stream << sz.width << "x" << sz.height; return stream;