55 template <std::
integral T>
88 template <std::ranges::input_range R, allocator A>
89 requires std::convertible_to<std::ranges::range_value_t<R>,
value_type>
110 template <
typename A>
111 requires(not std::same_as<A, dynamic_bitset<T>> and
allocator<A>)
122 template <allocator A>
134 template <allocator A>
153 template <allocator A>
171 template <allocator A>
191 template <allocator A>
268 template <
std::integral T>
277 template <std::
integral T>
278 template <allocator A>
285 template <std::
integral T>
286 template <allocator A>
298 template <std::
integral T>
299 template <allocator A>
306 template <std::
integral T>
307 template <allocator A>
314 template <std::
integral T>
315 template <allocator A>
323 template <std::
integral T>
330 template <std::
integral T>
337 template <std::
integral T>
338 template <allocator A>
344 template <std::
integral T>
345 template <allocator A>
351 template <std::
integral T>
354 if (start + length > this->
size())
356 throw std::out_of_range(
"slice: start + length exceeds bitset size");
364 template <std::
integral T>
367 if (start > this->
size())
369 throw std::out_of_range(
"slice: start exceeds bitset size");
372 return slice(start, this->
size() - start);
396 if (bitmap.
size() == 0)
398 return {size,
true, bitmap.
buffer().get_allocator()};
405 if (bitmap.size() == 0)
407 bitmap.resize(size,
true);
409 return std::move(bitmap);
413 template <std::ranges::input_range R>
414 requires(std::same_as<std::ranges::range_value_t<R>,
bool>)
420 for (
auto value : range)
424 bitmap.set(i,
false);
432 template <std::ranges::input_range R>
434 std::unsigned_integral<std::ranges::range_value_t<R>>
435 && !std::same_as<std::ranges::range_value_t<R>,
bool>
441 for (
auto index : range_of_indices)
443 bitmap.set(index,
false);
464 || (std::ranges::input_range<T>
465 && std::same_as<std::ranges::range_value_t<T>,
bool>)
466 || (std::ranges::input_range<T>
467 && std::unsigned_integral<std::ranges::range_value_t<T>>) )
468 && (!std::same_as<std::remove_cvref_t<T>, std::string>
469 && !std::same_as<std::remove_cvref_t<T>, std::string_view>
470 && !std::same_as<std::decay_t<T>,
const char*>);
502 template <val
idity_bitmap_input R>
Object that owns a piece of contiguous memory.
typename storage_type_without_cvrefpointer::value_type block_type
constexpr void set(size_type pos, value_type value)
static constexpr size_type compute_block_count(size_type bits_count) noexcept
constexpr size_type size() const noexcept
constexpr const storage_type_without_cvrefpointer & buffer() const noexcept
typename storage_type_without_cvrefpointer::size_type size_type
constexpr dynamic_bitset_base(storage_type buffer, size_type size)
constexpr size_type null_count() const noexcept
constexpr size_type offset() const noexcept
constexpr void zero_unused_bits()
A dynamic size sequence of bits with efficient storage and manipulation operations.
constexpr dynamic_bitset(dynamic_bitset &&) noexcept=default
typename storage_type::default_allocator default_allocator
Type of default allocator.
constexpr void resize(size_type n, value_type b=false)
constexpr iterator erase(const_iterator pos)
constexpr void clear() noexcept
constexpr iterator insert(const_iterator pos, value_type value)
constexpr dynamic_bitset(storage_type &&buf, size_type size, size_type offset)
Constructs a bitset by taking ownership of a storage buffer.
constexpr dynamic_bitset(size_type n, const A &a)
Constructs a bitset with n bits, all initialized to false.
constexpr dynamic_bitset(size_type n, value_type v, const A &a)
Constructs a bitset with n bits, all initialized to the specified value.
typename base_type::block_type block_type
Type of each storage block (same as T)
constexpr dynamic_bitset(const dynamic_bitset &)=default
constexpr dynamic_bitset(block_type *p, size_type n, const A &a)
Constructs a bitset using existing memory.
constexpr iterator emplace(const_iterator pos, value_type value)
constexpr void push_back(value_type value)
constexpr dynamic_bitset slice(size_type start, size_type length) const
constexpr dynamic_bitset(storage_type &&buf, size_type size, size_type offset, size_type null_count)
Constructs a bitset by taking ownership of a storage buffer with null count.
constexpr dynamic_bitset(block_type *p, size_type n, size_type offset, size_type null_count, const A &a)
Constructs a bitset using existing memory with offset and null count tracking.
constexpr dynamic_bitset(block_type *p, size_type n, size_type offset, const A &a)
Constructs a bitset using existing memory with null count tracking.
dynamic_bitset_base< buffer< T > > base_type
Base class type.
typename base_type::storage_type storage_type
Underlying storage container type.
typename base_type::value_type value_type
Type of individual bit values (bool)
typename base_type::size_type size_type
Type used for sizes and indices.
constexpr void pop_back()
constexpr ~dynamic_bitset()=default
constexpr dynamic_bitset(const R &r, const A &a)
Constructs a dynamic_bitset from an input range of convertible values.
constexpr dynamic_bitset(const A &a)
Default constructor.
#define SPARROW_ASSERT_TRUE(expr__)
sparrow::validity_bitmap validity_bitmap
validity_bitmap ensure_validity_bitmap_impl(std::size_t size, const validity_bitmap &bitmap)
constexpr std::size_t range_size(R &&r)
dynamic_bitset< std::uint8_t > validity_bitmap
Type alias for a validity bitmap using 8-bit storage blocks.
validity_bitmap ensure_validity_bitmap(std::size_t size, R &&validity_input)
Ensures a validity bitmap of the specified size from various input types.
Extensions to the C++ standard library.