<xstd/bits/bit_set/bit_set_view.hpp>¶
bit_set_view¶
template<bit_blocks Blocks, size_t N>
class bit_set_view {
public:
// types, lookups, iterators and set algebra as basic_bit_set's, with
template<class W>
requires see below
constexpr explicit bit_set_view(W&& blocks) noexcept;
template<class Owner>
requires see below
constexpr bit_set_view(Owner& c) noexcept;
};
template<class Owner>
requires see below
bit_set_view(Owner&) -> bit_set_view<see below>;
template<class W>
requires see below
bit_set_view(W&&) -> bit_set_view<see below>;
namespace std::ranges {
template<class Blocks, size_t N>
constexpr bool enable_view<xstd::bit_set_view<Blocks, N>> = true;
template<class Blocks, size_t N>
constexpr bool enable_borrowed_range<xstd::bit_set_view<Blocks, N>> = true;
}
The set reading of bits another object owns, as basic_bit_set over size_t keys, with:
Blocksnames the blocks the view refers to: a block, aspanof blocks, or the block container of the owner it views,constwhere they are;Nis their width in bits, ordynamic_extent.- The constructor from blocks is
explicit. It takes an lvalue block, or a range of blocks that is an lvalue or a borrowed range, and its guide deduces a block as itself and a range as thespanthat lends it, sobit_set_view(board)over auint64_tis abit_set_view<uint64_t>. - The constructor from an owner is implicit, and takes an lvalue owner of the set reading; a
constowner gives a view ofconstbits. A view of mutable bits converts implicitly to a view of the same bits asconst. - It has no default constructor, owns nothing, and is a
ranges::viewand a borrowed range. - Its modifiers write the bits it refers to, and exist only where those bits are not
const.insertover a run-time width grows the owner's storage. The compound operators take any set over the same storage and keys, owner or view; the non-member operators, which copy, are the owner's alone. ==and<=>compare it with whatever converts to it, its owner and lent blocks included, asstring_viewcompares.- It hashes what it presents:
hash<bit_set_view<Blocks, N>>and the Hash2 hook answer as for its owner.