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

◆ set()

template<uint32_t N = 256>
BitsetInlined & fl::BitsetInlined< N >::set ( uint32_t pos,
bool value = true )
inline

Sets or clears the bit at position pos.

Definition at line 332 of file bitset.h.

332 {
333 if (pos >= N && _storage.template is<fixed_bitset>()) {
334 resize(pos + 1);
335 }
336
337 if (_storage.template is<fixed_bitset>()) {
338 if (pos < N) {
339 _storage.template ptr<fixed_bitset>()->set(pos, value);
340 }
341 } else {
342 if (pos >= _storage.template ptr<bitset_dynamic>()->size()) {
343 _storage.template ptr<bitset_dynamic>()->resize(pos + 1);
344 }
346 }
347 return *this;
348 }
BitsetInlined & set(uint32_t pos, bool value=true)
Sets or clears the bit at position pos.
Definition bitset.h:332
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
A Bitset implementation with inline storage that can grow if needed.
Definition bitset.h:225

Referenced by operator&, operator^, operator|, fl::HashMap< Key, T, Hash, KeyEqual >::rehash_inline_no_resize(), and reset().

+ Here is the caller graph for this function: