diff --git a/cpp/src/board.hpp b/cpp/src/board.hpp index e58ccb9..b2d8e0d 100644 --- a/cpp/src/board.hpp +++ b/cpp/src/board.hpp @@ -57,3 +57,8 @@ struct Board { return colour_at(xy.to_index()); } }; + +inline bool operator<(const Board& m1, const Board& m2) { + return m1.to_fen() < m2.to_fen( + ); // TODO: make this the comparison between the hash of the board +} diff --git a/cpp/src/move.hpp b/cpp/src/move.hpp index 1e1b0f7..0f358b6 100644 --- a/cpp/src/move.hpp +++ b/cpp/src/move.hpp @@ -39,6 +39,10 @@ struct Move { } }; +inline bool operator<(const Move& m1, const Move& m2) { + return m1.to_string() < m2.to_string(); +} + inline std::ostream& operator<<(std::ostream& os, const Move& m) { os << m.to_string(); return os;