Make operator* a member of struct size

instead of being global
This commit is contained in:
Alan De Smet 2019-03-23 11:34:12 -05:00 committed by Stefan Haustein
parent 06467c38d8
commit f97c6e9eb0

View file

@ -392,10 +392,10 @@ struct size {
} }
unsigned int width; unsigned int width;
unsigned int height; unsigned int height;
}; size operator*(double scale) {
size operator*(size lhs, double scale) { return size(width*scale, height*scale);
return size(lhs.width*scale, lhs.height*scale);
} }
};
std::ostream& operator<<(std::ostream& stream, size sz) { std::ostream& operator<<(std::ostream& stream, size sz) {
stream << sz.width << "x" << sz.height; stream << sz.width << "x" << sz.height;
return stream; return stream;