+ MoveStack* generate_piece_moves<KING>(const Position&, MoveStack*, Color, Bitboard);
+
+ template<PieceType Piece, MoveType Type>
+ inline MoveStack* generate_piece_moves(const Position& p, MoveStack* m, Color us) {
+
+ assert(Piece == PAWN);
+
+ if (Type == CAPTURE)
+ return (us == WHITE ? generate_pawn_captures<WHITE, BLACK, Rank8BB, DELTA_NE, DELTA_NW, DELTA_N>(p, m)
+ : generate_pawn_captures<BLACK, WHITE, Rank1BB, DELTA_SE, DELTA_SW, DELTA_S>(p, m));
+ else
+ return (us == WHITE ? generate_pawn_noncaptures<WHITE, BLACK, Rank8BB, Rank3BB, DELTA_NE, DELTA_NW, DELTA_N>(p, m)
+ : generate_pawn_noncaptures<BLACK, WHITE, Rank1BB, Rank6BB, DELTA_SE, DELTA_SW, DELTA_S>(p, m));
+ }