FastLED 3.9.15
Loading...
Searching...
No Matches

◆ all()

template<uint32_t N>
bool fl::BitsetFixed< N >::all ( ) const
inlinenoexcept

Definition at line 151 of file bitset.h.

151 {
152 if (N == 0)
153 return true;
154
155 // Check all complete blocks
156 for (uint32_t i = 0; i < block_count - 1; ++i) {
157 if (_blocks[i] != ~block_type(0)) {
158 return false;
159 }
160 }
161
162 // Check the last block
163 if (block_count > 0) {
165 if (N % bits_per_block != 0) {
166 // Create a mask for the valid bits in the last block
167 mask = (block_type(1) << (N % bits_per_block)) - 1;
168 } else {
169 mask = ~block_type(0);
170 }
171
172 if ((_blocks[block_count - 1] & mask) != mask) {
173 return false;
174 }
175 }
176
177 return true;
178 }
static constexpr uint32_t block_count
Definition bitset.h:24
block_type _blocks[block_count]
Definition bitset.h:29
uint64_t block_type
Definition bitset.h:26
static constexpr uint32_t bits_per_block
Definition bitset.h:23
A simple fixed-size Bitset implementation similar to std::Bitset.
Definition bitset.h:21

References _blocks, bits_per_block, and block_count.