Examples for using bitset containers.
Examples for using bitset containers.
#include <stdio.h>
#define EXCLUSIVE_END_INDEX 128
#define NAME bitset
bitset_set(&bs, 0, true);
bitset_set(&bs, 5, true);
for (bitset_index_t i = 0; i < 128; i++) {
if (bitset_get(&bs, i)) {
printf("Bit at index %u is set\n", i);
}
}
DC_FOR_CONST(bitset, &bs, iter, index) { printf(
"Iterated index: %u\n", index); }
}
return 0;
}
static void example_basic()
static DC_PUBLIC dc_debug_fmt dc_debug_fmt_new()
#define DC_FOR_CONST(TYPE, INSTANCE, ITER, ITEM)
#define DC_SCOPED(type,...)
RAII in C. Call the destructor when the variable goes out of scope.