<xstd/bits/bit_span/bit_subspan.hpp>¶
bit_subspan¶
template<bit_blocks Blocks, size_t Extent, size_t N>
class bit_subspan {
public:
// as bit_span, with
static constexpr size_t extent = Extent;
template<class OtherBlocks, size_t OtherExtent>
requires see below
constexpr explicit(Extent != dynamic_extent) bit_subspan(const bit_subspan<OtherBlocks, OtherExtent, N>& other)
noexcept;
};
A window: the part of a bit_span or of another window that first, last and subspan return. As bit_span,
with:
- It stores what
spanstores, the start split over a pointer and a position because bits are not addressable, and the count whereExtentisdynamic_extent: three words, or two at a static extent. - It is made by
first,lastandsubspan, which on a window return a window over the sameBlocksandN. Between extents the rule isspan's: a static window converts to a dynamic one implicitly, and a dynamic one to a static one explicitly. Preconditions: the sizes agree. A window of mutable bits converts to one ofconstbits. - At a static extent,
size,emptyandmax_sizeare constants of the type, as forbasic_bit_array; at the dynamic extent they are functions, andmax_size()issize(). - A write to a window masks its end blocks, so the bits around it, which share those blocks, are untouched.