From ef431a1eb6167f72942ee2304664566200cf57f5 Mon Sep 17 00:00:00 2001 From: Arthur Bols Date: Tue, 20 Dec 2022 20:41:25 +0100 Subject: [PATCH] [Move] Implement < operator --- Move.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Move.cpp b/Move.cpp index 74b05c8..c1bb590 100644 --- a/Move.cpp +++ b/Move.cpp @@ -47,9 +47,13 @@ std::ostream &operator<<(std::ostream &os, const Move &move) { } bool operator<(const Move &lhs, const Move &rhs) { - (void) lhs; - (void) rhs; - return false; + if (!(lhs.from() == rhs.from())) + return lhs.from() < rhs.from(); + + if (!(lhs.to() == rhs.to())) + return lhs.to() < rhs.to(); + + return lhs.promotion() < rhs.promotion(); } bool operator==(const Move &lhs, const Move &rhs) {