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

◆ all()

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

Definition at line 273 of file bitset_dynamic.h.

273 {
274 if (_size == 0)
275 return true;
276
277 if (!_blocks) return false;
278
279 for (fl::u32 i = 0; i < _block_count - 1; ++i) {
280 if (_blocks[i] != static_cast<block_type>(~block_type(0)))
281 return false;
282 }
283
284 // Check last block with mask for valid bits
285 if (_block_count > 0) {
286 fl::u32 last_bit_pos = (_size - 1) % bits_per_block;
287 block_type mask =
288 static_cast<block_type>((static_cast<block_type>(1) << (last_bit_pos + 1)) - 1);
289 return (_blocks[_block_count - 1] & mask) == mask;
290 }
291
292 return true;
293 }
block_type * _blocks
static constexpr fl::u32 bits_per_block

References _block_count, _blocks, _size, and bits_per_block.