update 22

This commit is contained in:
2024-09-02 15:20:25 -07:00
parent 9aa821376c
commit 9e6223f886
4 changed files with 300 additions and 18 deletions

View File

@@ -13,10 +13,10 @@ namespace aocpp {
/// Coordinate where y grows down and x grows right
struct Coord {
std::int64_t x, y;
auto operator<=>(const Coord&) const = default;
friend auto operator<=>(const Coord&, const Coord&) = default;
};
auto Draw(std::ostream & out, std::map<Coord, std::int64_t> image) -> void;
auto Draw(std::ostream & out, std::map<Coord, std::int64_t> const& image) -> void;
/// Move one unit up
auto Up(Coord) -> Coord;
@@ -80,7 +80,6 @@ auto operator*=(Coord &, std::int64_t) -> Coord &;
template<>
struct std::hash<aocpp::Coord>
{
using is_transparent = void;
auto operator()(aocpp::Coord const& c) const noexcept -> std::size_t {
std::hash<std::int64_t> h;
return h(c.x) ^ h(c.y);