[Move] Implement < operator

This commit is contained in:
2022-12-20 20:41:25 +01:00
parent 66a18c4a73
commit ef431a1eb6

View File

@@ -47,9 +47,13 @@ std::ostream &operator<<(std::ostream &os, const Move &move) {
} }
bool operator<(const Move &lhs, const Move &rhs) { bool operator<(const Move &lhs, const Move &rhs) {
(void) lhs; if (!(lhs.from() == rhs.from()))
(void) rhs; return lhs.from() < rhs.from();
return false;
if (!(lhs.to() == rhs.to()))
return lhs.to() < rhs.to();
return lhs.promotion() < rhs.promotion();
} }
bool operator==(const Move &lhs, const Move &rhs) { bool operator==(const Move &lhs, const Move &rhs) {