<xstd/bits/ext/boost/bit_small_vector.hpp>¶
basic_bit_small_vector, bit_small_vector¶
template<unsigned_integer Block, size_t N, class Alloc = boost::container::new_allocator<Block>>
requires see below
using basic_bit_small_vector = basic_bit_vector<boost::container::small_vector<Block, see below, Alloc>>;
template<size_t N>
using bit_small_vector = basic_bit_small_vector<size_t, N>;
A basic_bit_vector over boost::container::small_vector, with:
bit_small_vector<N>holds its bools insize_tblocks, theceil(N / D)blocks that holdNbits inline and the rest on the heap. The requires-clause admitsBlockasbasic_bit_vector's does, andAllocdefaults to Boost's own, assmall_vector's does.- The inline part is whole blocks, so
bit_small_vector<N>andbit_small_vector<M>are one type whereverceil(N / D) == ceil(M / D), andbit_rebindandbit_resizekeep the bits the inline blocks hold. allocator_typeis the small vector's, which wrapsAlloc, and every allocator argument is of that type. Constructing from an allocator does not throw, inline blocks allocating nothing.capacity(),reserveandshrink_to_fitare the small vector's.- Every exception is a standard one:
std::length_errorpastmax_size(), before the small vector would throw Boost's own, andstd::bad_allocfrom the allocator. Blocks taken out withextractare the small vector itself, and throwboost::containerexceptions unlessBOOST_CONTAINER_USE_STD_EXCEPTIONSis defined. - The header also brings
std::hashand Boost'sis_rangeandis_tuple_likefor it, whichbasic_bit_vector's headers declare. The Hash2 hook's model isvector<bool>.