<xstd/bits/bit_set/bit_fixed_set.hpp>¶
basic_bit_fixed_set, bit_fixed_set¶
template<class Key, unsigned_integer Block, size_t N, bit_index_mapping<Key> KeyMapping, see below Compare>
requires see below
class basic_bit_fixed_set {
public:
// types as basic_bit_set's, without allocator_type, with
using block_container_type = array<Block, see below>;
// construct: [set.cons]'s without the allocator forms, with
constexpr explicit basic_bit_fixed_set(indeterminate_t) noexcept;
template<class Bits>
requires see below
constexpr basic_bit_fixed_set(from_blocks_t, const Bits& b) noexcept;
constexpr basic_bit_fixed_set(const Key& mask) noexcept; // see below
constexpr operator Key() const noexcept; // see below
// capacity
static constexpr integral_constant<size_t, N> max_size = {};
};
constexpr auto operator~(const basic_bit_fixed_set& x) noexcept -> basic_bit_fixed_set;
template<unsigned_integer Block>
basic_bit_fixed_set(from_blocks_t, Block) -> basic_bit_fixed_set<size_t, Block, bit_blocks_extent_v<Block>>;
template<unsigned_integer Block, size_t K>
basic_bit_fixed_set(from_blocks_t, array<Block, K>)
-> basic_bit_fixed_set<size_t, Block, bit_blocks_extent_v<array<Block, K>>>;
template<unsigned_integer Block, size_t K>
basic_bit_fixed_set(from_blocks_t, const Block (&)[K])
-> basic_bit_fixed_set<size_t, Block, bit_blocks_extent_v<array<Block, K>>>;
template<class Enum>
requires is_enum_v<Enum> and sized_bit_index_mapping<bit_key_mapping<Enum>, Enum>
basic_bit_fixed_set(initializer_list<Enum>)
-> basic_bit_fixed_set<Enum, least_block_t<bit_key_mapping<Enum>::size>, bit_key_mapping<Enum>::size,
bit_key_mapping<Enum>>;
As basic_bit_set, with:
bit_fixed_set<N>holds the keys0toN - 1insize_tblocks. The requires-clause admitsBlockasbasic_bit_array's does. Mandates: whereKeyMappingmodelssized_bit_index_mapping<KeyMapping, Key>,KeyMapping::size == N.- There is no allocator, and neither
allocator_typenorget_allocator. The default constructor isnoexcept. indeterminate_tconstructor: Effects: Leaves the blocks default-initialized, writing nothing, at any width. Remarks: Until it is assigned, the only valid operations on the set are assignment and destruction. Seeindeterminate.max_sizeis a constant of the type,N;size()andempty()are functions that count the keys.insert,emplaceand the ranged forms throwout_of_rangefor a key whose position isNor more. An enumerator's|=,^=,-=and&=, the non-members over them, andoperator[]take a position belowNas their precondition, and arenoexcept.~xcomplements every key belowN.<<= nkeeps the keys that land belowN, and>>= nthe keys at or aboven; both are the native shifts, as an integer's are, withn < Nas their precondition.xstd::shlandxstd::shrare the total forms, which empty the set where the count isNor more and shift the other way for a negative count. Every operator over two sets isnoexcept.from_blocksconstructor: Asbasic_bit_array's: positioniis a key where bitiofbis set. The guides deduce the width the blocks name,Keybeingsize_t.xstd::bit_convertgoes the other way, from the set to a block, an array of blocks or astd::bitset, positionistaying positioni.- The
initializer_listguide deduces, from a list of enumerators whosebit_key_mappingnames a size, the typebit_enum_set<Enum>names. - It is a structural type exactly where
Nfills its blocks, asbit_align<bit_fixed_set<N>>does at anyN. - The mask members, present only where
bit_mask_mapping<KeyMapping, Key>holds, which reads every value ofKeyas the block of its one-bit keys:- The constructor from a mask is implicit and sets the keys whose bits the mask has. Preconditions: the mask has
no bit at or above
N. - The conversion to
Keyis implicit and returns the mask with this set's keys. - The
initializer_listconstructor is the union of its values, andnoexcept. &,|,^and-take a mask on either side, and&=,|=,^=and-=one on the right, each over the mask's exact type.&and-with the mask on the right are total, the mask's bits at or aboveNmeeting nothing; the others have the constructor's precondition.set == maskis total, and false for a mask with a bit at or aboveN.
- The constructor from a mask is implicit and sets the keys whose bits the mask has. Preconditions: the mask has
no bit at or above