![]() |
Pixie
|
Builder for a packed LSB-first bit sequence. More...
#include <packed_bit_builder.h>
Public Member Functions | |
| void | write_bit (bool bit) |
| Append one bit. | |
| void | write_bits (std::uint64_t bits, std::size_t width) |
Append the low width bits of bits, least-significant bit first. | |
| std::size_t | size_bits () const noexcept |
| Return the number of appended bits. | |
| void | reserve_bits (std::size_t size_bits) |
Reserve storage for at least size_bits bits. | |
| std::vector< std::uint64_t > | take_words () |
| Transfer the packed words and reset this builder. | |
Builder for a packed LSB-first bit sequence.
This type is intended for constructing succinct bit vectors, not for persistent serialization. take_words() transfers the packed words and resets the builder to an empty, reusable state.
|
inline |
Append the low width bits of bits, least-significant bit first.
| std::invalid_argument | if width is greater than 64. |
| std::length_error | if the resulting bit count is not representable. |