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

◆ flip() [2/2]

template<uint32_t N = 256>
BitsetInlined & fl::BitsetInlined< N >::flip ( uint32_t pos)
inline

Flips (toggles) the bit at position pos.

Definition at line 354 of file bitset.h.

354 {
355 if (pos >= N && _storage.template is<fixed_bitset>()) {
356 resize(pos + 1);
357 }
358
359 if (_storage.template is<fixed_bitset>()) {
360 if (pos < N) {
361 _storage.template ptr<fixed_bitset>()->flip(pos);
362 }
363 } else {
364 if (pos >= _storage.template ptr<bitset_dynamic>()->size()) {
365 _storage.template ptr<bitset_dynamic>()->resize(pos + 1);
366 }
368 }
369 return *this;
370 }
uint32_t size() const noexcept
Size of the Bitset (number of bits).
Definition bitset.h:430
void resize(uint32_t new_size)
Definition bitset.h:291
BitsetInlined & flip(uint32_t pos)
Flips (toggles) the bit at position pos.
Definition bitset.h:354
A Bitset implementation with inline storage that can grow if needed.
Definition bitset.h:225

Referenced by operator~.

+ Here is the caller graph for this function: