added the less than operator to store the objects

in maps
This commit is contained in:
Karma Riuk 2025-02-06 15:57:21 +01:00
parent 32c7832001
commit 1231e4da92
2 changed files with 9 additions and 0 deletions

View File

@ -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
}

View File

@ -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;