16void to_string(
const fl::u16 *bit_data, fl::u32 bit_count,
string* dst);
43 if (other.
_size > 0) {
53 other._blocks =
nullptr;
54 other._block_count = 0;
61 if (other.
_size > 0) {
79 other._blocks =
nullptr;
80 other._block_count = 0;
107 _blocks[last_block_idx] &= mask;
121 if (new_size ==
_size)
148 _blocks[last_block_idx] &= mask;
196 void set(fl::u32
pos,
bool value)
noexcept {
230 _blocks[last_block_idx] &= mask;
241 return (
_blocks[idx] >> off) & 1;
253 result +=
static_cast<fl::u32
>(__builtin_popcount(
_blocks[i]));
259 bool any() const noexcept {
273 bool all() const noexcept {
298 fl::u32
size() const noexcept {
325 for (fl::u32 block_idx = start_block; block_idx <
_block_count; ++block_idx) {
334 current_block &= mask;
339 current_block = ~current_block;
343 if (block_idx == start_block && start_bit > 0) {
344 current_block &= ~static_cast<block_type>(((
block_type(1) << start_bit) - 1));
348 if (current_block != 0) {
350 fl::u32 bit_pos =
static_cast<fl::u32
>(__builtin_ctz(current_block));
354 if (absolute_pos <
_size) {
355 return static_cast<fl::i32
>(absolute_pos);
373 for (fl::u32 i = 0; i < min_blocks; ++i) {
390 for (fl::u32 i = 0; i < min_blocks; ++i) {
413 for (fl::u32 i = 0; i < min_blocks; ++i) {
444 result._blocks[last_block_idx] &= mask;
bool all() const noexcept
bitset_dynamic & operator=(const bitset_dynamic &other)
bool operator[](fl::u32 pos) const noexcept
FL_DISABLE_WARNING_POP void clear()
bool none() const noexcept
FL_DISABLE_WARNING_POP FL_DISABLE_WARNING_PUSH FL_DISABLE_WARNING_NULL_DEREFERENCE void set(fl::u32 pos) noexcept
bitset_dynamic operator&(const bitset_dynamic &other) const
FL_DISABLE_WARNING_PUSH FL_DISABLE_WARNING_NULL_DEREFERENCE fl::u32 size() const noexcept
FL_DISABLE_WARNING_POP fl::u32 count() const noexcept
bitset_dynamic operator|(const bitset_dynamic &other) const
bitset_dynamic(const bitset_dynamic &other)
FL_DISABLE_WARNING_PUSH FL_DISABLE_WARNING_NULL_DEREFERENCE void flip(fl::u32 pos) noexcept
FL_DISABLE_WARNING_PUSH FL_DISABLE_WARNING_NULL_DEREFERENCE void assign(fl::u32 n, bool value)
FL_DISABLE_WARNING_POP void flip() noexcept
FL_DISABLE_WARNING_PUSH FL_DISABLE_WARNING_NULL_DEREFERENCE bool test(fl::u32 pos) const noexcept
static fl::u32 calc_block_count(fl::u32 bit_count)
FL_DISABLE_WARNING_PUSH FL_DISABLE_WARNING_NULL_DEREFERENCE void reset() noexcept
FL_DISABLE_WARNING_POP FL_DISABLE_WARNING_PUSH FL_DISABLE_WARNING_NULL_DEREFERENCE void resize(fl::u32 new_size)
bitset_dynamic operator~() const
FL_DISABLE_WARNING_POP FL_DISABLE_WARNING_PUSH FL_DISABLE_WARNING_NULL_DEREFERENCE void reset(fl::u32 pos) noexcept
fl::i32 find_first(bool test_value, fl::u32 offset=0) const noexcept
Finds the first bit that matches the test value.
FL_DISABLE_WARNING_POP void set(fl::u32 pos, bool value) noexcept
static constexpr fl::u32 bits_per_block
bool any() const noexcept
bitset_dynamic operator^(const bitset_dynamic &other) const
bitset_dynamic(bitset_dynamic &&other) noexcept
bitset_dynamic & operator=(bitset_dynamic &&other) noexcept
FL_DISABLE_WARNING_POP void to_string(string *dst) const
bitset_dynamic(fl::u32 size)
Result type for promise operations.
#define FL_DISABLE_WARNING_PUSH
#define FL_DISABLE_WARNING_NULL_DEREFERENCE
#define FL_DISABLE_WARNING_POP
UISlider offset("Offset", 0.0f, 0.0f, 1.0f, 0.01f)
void to_string(const fl::u16 *bit_data, fl::u32 bit_count, string *dst)
void * memfill(void *ptr, int value, fl::size num)