update 22
This commit is contained in:
@@ -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);
|
||||
|
@@ -4,7 +4,7 @@
|
||||
|
||||
namespace aocpp {
|
||||
|
||||
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 {
|
||||
std::int64_t minX = 0, maxX = 0, minY = 0, maxY = 0;
|
||||
for (auto&& [k, _] : image) {
|
||||
auto [x,y] = k;
|
||||
|
Reference in New Issue
Block a user