dinkyecs_sandbox/point.hpp

26 lines
409 B
C++
Raw Normal View History

2025-02-13 19:40:37 +03:00
#pragma once
#include <vector>
2025-02-13 19:47:52 +03:00
struct Point
{
size_t x = 0;
size_t y = 0;
2025-02-13 19:40:37 +03:00
2025-02-13 19:47:52 +03:00
bool operator==(const Point &other) const
{
return other.x == x && other.y == y;
}
2025-02-13 19:40:37 +03:00
};
typedef std::vector<Point> PointList;
2025-02-13 19:56:57 +03:00
template <>
struct std::hash<Point>
2025-02-13 19:47:52 +03:00
{
size_t operator()(const Point &p) const
{
auto hasher = std::hash<int>();
return hasher(p.x) ^ hasher(p.y);
}
2025-02-13 19:40:37 +03:00
};