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

◆ operator~()

bitset_dynamic fl::bitset_dynamic::operator~ ( ) const
inline

Definition at line 320 of file bitset_dynamic.h.

320 {
321 bitset_dynamic result(_size);
322
323 for (uint32_t i = 0; i < _block_count; ++i) {
324 result._blocks[i] = ~_blocks[i];
325 }
326
327 // Clear any bits beyond size
328 if (_block_count > 0 && _size % bits_per_block != 0) {
329 uint32_t last_block_idx = (_size - 1) / bits_per_block;
330 uint32_t last_bit_pos = (_size - 1) % bits_per_block;
331 block_type mask =
332 (static_cast<block_type>(1) << (last_bit_pos + 1)) - 1;
333 result._blocks[last_block_idx] &= mask;
334 }
335
336 return result;
337 }
static constexpr uint32_t bits_per_block
block_type * _blocks
bitset_dynamic()=default

References bitset_dynamic(), _block_count, _blocks, _size, and bits_per_block.

+ Here is the call graph for this function: