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

◆ all()

bool fl::bitset_dynamic::all ( ) const
inlinenoexcept

Definition at line 245 of file bitset_dynamic.h.

245 {
246 if (_size == 0)
247 return true;
248
249 for (uint32_t i = 0; i < _block_count - 1; ++i) {
250 if (_blocks[i] != ~static_cast<block_type>(0))
251 return false;
252 }
253
254 // Check last block with mask for valid bits
255 if (_block_count > 0) {
256 uint32_t last_bit_pos = (_size - 1) % bits_per_block;
257 block_type mask =
258 (static_cast<block_type>(1) << (last_bit_pos + 1)) - 1;
259 return (_blocks[_block_count - 1] & mask) == mask;
260 }
261
262 return true;
263 }
static constexpr uint32_t bits_per_block
block_type * _blocks

References _block_count, _blocks, _size, and bits_per_block.