Skip to content

Engine → Core

bit_vector.h

A dynamically sized set of bits packed into 64-bit words. Used for component masks, free-slot tracking and dirty flags. Bits past size() are always zero, so whole-word operations (count, any, equality, bitwise ops) need no masking at the call site. A moved-from bit_vector is empty (size 0, no words) and fully reusable. Not thread-safe.

Classes

File Description
bit_vector A dynamically sized set of bits packed into 64-bit words. Used for component masks, free-slot tracking and dirty flags. Bits past size() are always zero, so whole-word operations (count, any, equality, bitwise ops) need no masking at the call site. A moved-from bit_vector is empty (size 0, no words) and fully reusable. Not thread-safe.
bit_vector::set_bit_iterator Forward iterator over the indices of the set bits, ascending. Dereferencing yields the index by value, so it models std::forward_iterator (C++20) but only the legacy input iterator category, exactly like std::ranges::iota_view's iterator.
bit_vector::set_bit_range Range over the set bits: for (usize index: bits.set_bits()) { ... }. Its iterators refer to the bit_vector, not to the range object, so it is a borrowed range and std::ranges algorithms may take it by value: std::ranges::find(bits.set_bits(), 7).

Type Aliases

bit_vector::set_bit_iterator::difference_type

using difference_type = isize;

bit_vector::set_bit_iterator::iterator_category

using iterator_category = std::input_iterator_tag;

bit_vector::set_bit_iterator::iterator_concept

using iterator_concept = std::forward_iterator_tag;

bit_vector::set_bit_iterator::pointer

using pointer = const usize *;

bit_vector::set_bit_iterator::reference

using reference = usize;

bit_vector::set_bit_iterator::value_type

using value_type = usize;

Constants

Name Type Value Description
set_bit_range template <> inline constexpr bool std::ranges::enable_borrowed_range<conjure::core::bit_vector::> true