This commit is contained in:
2023-04-08 16:54:22 -07:00
parent c221dc9bf2
commit b4e2592c81
6 changed files with 165 additions and 0 deletions

View File

@@ -95,6 +95,22 @@ auto operator-=(Coord & a, Coord b) -> Coord & {
return a;
}
auto operator*(Coord a, std::int64_t b) -> Coord {
return a *= b;
}
auto operator*(std::int64_t a, Coord b) -> Coord {
b.x *= a;
b.y *= a;
return b;
}
auto operator*=(Coord & a, std::int64_t b) -> Coord & {
a.x *= b;
a.y *= b;
return a;
}
auto operator<<(std::ostream & out, Coord c) -> std::ostream & {
return out << "(" << c.x << "," << c.y << ")";
}