I'm programming a 4x4 board game in C++ using bitboards in a 64-bit machine. I only need 16 bits to implement the board. Should I use:
I don't know if it helps, but my processor is: Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz 1.99 GHz
uint16_t
.uint_fast16_t
.uint64_t
may be useful, too, for making an array of values aligned at 8-byte boundaries. This is unlikely to give you much benefits, though, because it comes at the price of wasting 75% of memory allocated for the array, along with the associated loss in cache performance.Note: you may end up using the same type as uint64_t
if your library maps uint_fast16_t
to uint64_t
.