return b & (b - 1);
}
+inline bool opposite_colors(Square s1, Square s2) {
+ return bool(DarkSquares & s1) != bool(DarkSquares & s2);
+}
+
/// rank_bb() and file_bb() return a bitboard representing all the squares on
/// the given file or rank.
}
+/// double_pawn_attacks_bb() returns the pawn attacks for the given color
+/// from the squares in the given bitboard.
+
+template<Color C>
+constexpr Bitboard double_pawn_attacks_bb(Bitboard b) {
+ return C == WHITE ? shift<NORTH_WEST>(b) & shift<NORTH_EAST>(b)
+ : shift<SOUTH_WEST>(b) & shift<SOUTH_EAST>(b);
+}
+
+
/// adjacent_files_bb() returns a bitboard representing all the squares on the
/// adjacent files of the given one.