[Move] Implement << operator

This commit is contained in:
2022-12-18 21:01:59 +01:00
parent 864b46be9e
commit 66a18c4a73

View File

@@ -39,7 +39,10 @@ std::optional<PieceType> Move::promotion() const {
}
std::ostream &operator<<(std::ostream &os, const Move &move) {
(void) move;
os << move.from() << move.to();
if (move.promotion().has_value()) {
os << static_cast<char>(move.promotion().value());
}
return os;
}