mirror of
https://github.com/opelly27/Stockfish.git
synced 2026-05-20 13:17:44 +00:00
Introduce operator~(Piece c)
Small syntactic sugar to reverse piece color. No functional change.
This commit is contained in:
@@ -359,6 +359,10 @@ inline Square operator~(Square s) {
|
||||
return Square(s ^ 56); // Vertical flip SQ_A1 -> SQ_A8
|
||||
}
|
||||
|
||||
inline Piece operator~(Piece c) {
|
||||
return Piece(c ^ 8);
|
||||
}
|
||||
|
||||
inline Square operator|(File f, Rank r) {
|
||||
return Square((r << 3) | f);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user