Make operator* a member of struct size
instead of being global
This commit is contained in:
parent
06467c38d8
commit
f97c6e9eb0
1 changed files with 3 additions and 3 deletions
|
@ -392,10 +392,10 @@ struct size {
|
||||||
}
|
}
|
||||||
unsigned int width;
|
unsigned int width;
|
||||||
unsigned int height;
|
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) {
|
std::ostream& operator<<(std::ostream& stream, size sz) {
|
||||||
stream << sz.width << "x" << sz.height;
|
stream << sz.width << "x" << sz.height;
|
||||||
return stream;
|
return stream;
|
||||||
|
|
Loading…
Reference in a new issue