Review
- The postfix
AtIndex
is too verbose. You don't have any other operations likeAtMask
or anything and theindex
is provided as argument. So I would preferIsBitSet
overIsBitSetAtIndex
etc. - The index is sometimes a
byte
, sometimes auint
. I would not bother with such level of (over-)engineered type picks. Stick with the common type for an indexint
. You can always add argument checks for bounds. - You can replace
1 << 7 - index
with1 << index
in your operations. This is written more compactly and is a well known bit operation technique. Right-to-left indexes are more common in bitwise systems.