/// pop_lsb() finds and clears the least significant bit in a non-zero bitboard
inline Square pop_lsb(Bitboard* b) {
+ assert(*b);
const Square s = lsb(*b);
*b &= *b - 1;
return s;
}
-/// frontmost_sq() returns the most advanced square for the given color
+/// frontmost_sq() returns the most advanced square for the given color,
+/// requires a non-zero bitboard.
inline Square frontmost_sq(Color c, Bitboard b) {
+ assert(b);
return c == WHITE ? msb(b) : lsb(b);
}