dinkyecs_sandbox/point.hpp
2025-02-13 19:40:37 +03:00

21 lines
377 B
C++

#pragma once
#include <vector>
struct Point {
size_t x = 0;
size_t y = 0;
bool operator==(const Point& other) const {
return other.x == x && other.y == y;
}
};
typedef std::vector<Point> PointList;
template<> struct std::hash<Point> {
size_t operator()(const Point& p) const {
auto hasher = std::hash<int>();
return hasher(p.x) ^ hasher(p.y);
}
};