|
|
constexpr | BitSet () |
| | Default constructor: all bits set to zero.
|
| |
| constexpr | BitSet (storage_t value) |
| | Construct with a single storage value repeated for all words.
|
| |
|
void | set () noexcept |
| | Set all bits to 1.
|
| |
|
void | reset () noexcept |
| | Set all bits to 0.
|
| |
| void | set (uint16_t pos) noexcept |
| | Set the bit at position pos to 1.
|
| |
| void | set (uint16_t pos, bool value) noexcept |
| | Set the bit at position pos to the given value.
|
| |
| void | reset (uint16_t pos) noexcept |
| | Clear the bit at position pos.
|
| |
| void | flip (uint16_t pos) noexcept |
| | Flip (invert) the bit at position pos.
|
| |
| constexpr bool | test (uint16_t pos) const noexcept |
| | Get the value of the bit at position pos.
|
| |
|
constexpr bool | operator[] (uint16_t pos) const noexcept |
| | Alias for test(pos)
|
| |
|
reference | operator[] (uint16_t pos) noexcept |
| | Non-const operator[] returning a proxy for bit manipulation.
|
| |
| constexpr uint16_t | count () const noexcept |
| | Count the number of bits set to 1.
|
| |
|
constexpr bool | any () const noexcept |
| | Return true if any bit is set.
|
| |
|
constexpr bool | all () const noexcept |
| | Return true if all bits are set.
|
| |
|
constexpr bool | none () const noexcept |
| | Return true if no bits are set.
|
| |
|
void | flip () noexcept |
| | Flip all bits.
|
| |
| constexpr BitSet< N > | operator& (const BitSet< N > &other) const noexcept |
| | Compute the intersection of this bitset with another.
|
| |
| constexpr BitSet< N > | operator| (const BitSet< N > &other) const noexcept |
| | Compute the union of this bitset with another.
|
| |
| constexpr BitSet< N > | operator- (const BitSet< N > &other) const noexcept |
| | Compute the difference of this bitset with another.
|
| |
| BitSet< N > | operator~ () const noexcept |
| | Compute the bitwise NOT of this bitset.
|
| |
|
BitSet< N > & | operator&= (const BitSet< N > &other) noexcept |
| | In-place bitwise AND.
|
| |
|
BitSet< N > & | operator|= (const BitSet< N > &other) noexcept |
| | In-place bitwise OR.
|
| |
|
BitSet< N > & | operator^= (const BitSet< N > &other) noexcept |
| | In-place bitwise XOR.
|
| |
|
constexpr bool | operator== (const BitSet< N > &other) const noexcept |
| | Check equality with another bitset.
|
| |
|
constexpr bool | operator!= (const BitSet< N > &other) const noexcept |
| | Check inequality with another bitset.
|
| |
template<uint16_t N>
class lampda::common::BitSet< N >
A compact, zero-allocation bitset for compile-time sized bit arrays.
This is a lightweight alternative to std::bitset, designed for embedded environments where std::bitset may not be available or desirable.
- Template Parameters
-
| N | The number of bits in the bitset |