mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-22 01:56:58 +08:00
Introduce variadic make_bitboard()
Adds a helper function to make a bitboard from a list of squares. No functional change
This commit is contained in:
committed by
Stéphane Nicolet
parent
450f04969c
commit
3192b09fe0
@@ -150,7 +150,17 @@ inline Bitboard file_bb(Square s) {
|
||||
}
|
||||
|
||||
|
||||
/// shift() moves a bitboard one step along direction D. Mainly for pawns
|
||||
/// make_bitboard() returns a bitboard from a list of squares
|
||||
|
||||
constexpr Bitboard make_bitboard() { return 0; }
|
||||
|
||||
template<typename ...Squares>
|
||||
constexpr Bitboard make_bitboard(Square s, Squares... squares) {
|
||||
return (1ULL << s) | make_bitboard(squares...);
|
||||
}
|
||||
|
||||
|
||||
/// shift() moves a bitboard one step along direction D (mainly for pawns)
|
||||
|
||||
template<Direction D>
|
||||
constexpr Bitboard shift(Bitboard b) {
|
||||
|
||||
Reference in New Issue
Block a user