Template Class BitArray
Defined in File binary.h
Class Documentation
-
template<std::size_t Bits>
class BitArray Fixed-size packed bit array.
Storage uses the smallest fixed-width integer that can hold the requested bits without exceeding the platform’s native word size. Larger arrays are split across native words.
Bit zero is the least-significant bit. Mutable indexing returns a proxy so individual bits can be assigned as though they were ordinary booleans. words() exposes the same packed storage as a contiguous word array. Indices must be below Bits; assertions are not checked release-mode errors. Spans/proxies borrow this array. Access is unsynchronized, including writes to different bits in one word; whole-word access can modify unused high bits. Native storage/byte order is not a portable serialized representation.
Public Types
Public Functions
-
bool operator[](std::size_t index) const noexcept
-
std::span<word_type, word_count> words() noexcept
-
std::span<const word_type, word_count> words() const noexcept
-
bool operator[](std::size_t index) const noexcept