]> git.sesse.net Git - stockfish/blobdiff - src/types.h
Introduce operator~(Piece c)
[stockfish] / src / types.h
index 653ebade2f805b55a942269cbb76cceb154eac38..ac2ca0e78d9a4ea5d0b5497244de1f14339855f2 100644 (file)
@@ -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);
 }