17#ifndef HOOVER_CHESS_UTILS__PGN_READER__LOOKUP_UTILS_H_INCLUDED
18#define HOOVER_CHESS_UTILS__PGN_READER__LOOKUP_UTILS_H_INCLUDED
63template <
typename U64Type>
66 static_assert(
sizeof(U64Type) == 8U);
72 const std::uint8_t *ptr { std::bit_cast<const std::uint8_t *>(array.data()) };
73 const U64Type *ptrAdjusted { std::bit_cast<const U64Type *>(ptr +
static_cast<std::ptrdiff_t
>(turn)) };
91template <
typename U64Type, std::
size_t N>
93 const std::array<std::array<U64Type, 2U>, N> &array, std::size_t i,
Color turn)
noexcept
95 static_assert(
sizeof(U64Type) == 8U);
102 const std::uint8_t *ptr { std::bit_cast<const std::uint8_t *>(array.data()) };
103 const U64Type *ptrAdjusted {
104 std::bit_cast<const U64Type *>(
105 ptr +
static_cast<std::ptrdiff_t
>(turn) + 16U * i) };
Color
Color of a piece or side to move.
Definition chessboard-types.h:194
@ BLACK
Black piece or black side to move.
@ WHITE
White piece or white side to move.
const U64Type & turnSpecificLookup(const std::array< U64Type, 2U > &array, Color turn) noexcept
Piece attack tables.
Definition lookup-utils.h:64
const U64Type & turnSpecificArrayLookup(const std::array< std::array< U64Type, 2U >, N > &array, std::size_t i, Color turn) noexcept
Optimized lookup for arrays indexed by general index and turn (side-to-move).
Definition lookup-utils.h:92
Definition chessboard-types-squareset.h:30