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

◆ operator~()

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

Definition at line 434 of file bitset_dynamic.h.

434 {
436
437 if (!_blocks || !result._blocks) {
438 return result;
439 }
440
441 for (fl::u32 i = 0; i < _block_count; ++i) {
442 result._blocks[i] = ~_blocks[i];
443 }
444
445 // Clear any bits beyond size
446 if (_block_count > 0 && _size % bits_per_block != 0) {
447 fl::u32 last_block_idx = (_size - 1) / bits_per_block;
448 fl::u32 last_bit_pos = (_size - 1) % bits_per_block;
449 block_type mask =
450 static_cast<block_type>((static_cast<block_type>(1) << (last_bit_pos + 1)) - 1);
451 result._blocks[last_block_idx] &= mask;
452 }
453
454 return result;
455 }
fl::unique_ptr< block_type[]> _blocks
bitset_dynamic()=default
static constexpr fl::u32 bits_per_block
expected< T, E > result
Alias for expected (Rust-style naming)
Definition result.h:31

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

+ Here is the call graph for this function: