Word128

Declared in astar/SlidingTile.h; the same struct on the site of Doxygen.

struct Word128

an unsigned integer of 128 bits, as two words of 64

It has the operations on bits that a packed board needs (and, or, exclusive or, not, the shifts and the count of the trailing zeros), written on two words so that they are the same with every compiler, none of which has to offer an integer of 128 bits; it is trivially copyable, and two of them are equal if their words are.

Public Functions

constexpr Word128(void) noexcept = default
inline constexpr Word128(std::uint64_t l) noexcept

the integer of value l

inline constexpr Word128(std::uint64_t l, std::uint64_t h) noexcept

the integer of the words l and h

inline explicit constexpr operator std::uint64_t(void) const noexcept

the bits 0 to 63

inline Word128 &operator|=(Word128 b) noexcept

Public Members

std::uint64_t lo = 0

the bits 0 to 63

std::uint64_t hi = 0

the bits 64 to 127

Friends

friend constexpr bool operator==(const Word128 &a, const Word128 &b) noexcept = default
inline friend constexpr Word128 operator&(Word128 a, Word128 b) noexcept
inline friend constexpr Word128 operator|(Word128 a, Word128 b) noexcept
inline friend constexpr Word128 operator^(Word128 a, Word128 b) noexcept
inline friend constexpr Word128 operator~(Word128 a) noexcept
inline friend constexpr Word128 operator<<(Word128 a, int n) noexcept

the shift to the left by n bits, \( 0 \leq n < 128 \)

inline friend constexpr Word128 operator>>(Word128 a, int n) noexcept

the shift to the right by n bits, \( 0 \leq n < 128 \)

inline friend constexpr int countr_zero(Word128 a) noexcept

the number of trailing zero bits, 128 if a is 0