[#bitdeque] = bitdeque :mrdocs: Class that mimics std::deque<bool>, but with std::vector<bool>'s bit packing. == Synopsis Declared in `<util/bitdeque.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<int BITS_PER_WORD = 4096 * 8> class bitdeque; ---- == Description BITS_PER_WORD selects the (minimum) number of bits that are allocated at once. Larger values reduce the asymptotic memory usage overhead, at the cost of needing larger up‐front allocations. The default is 4096 bytes. == Type Aliases [cols="1,4"] |=== | Name| Description | xref:bitdeque/const_iterator.adoc[`const_iterator`] | Read‐only random‐access iterator over the bits. | xref:bitdeque/const_pointer.adoc[`const_pointer`] | Const pointer type, void because individual bits are not addressable. | xref:bitdeque/const_reference.adoc[`const_reference`] | Read‐only reference to a single bit (a plain bool by value). | xref:bitdeque/const_reverse_iterator.adoc[`const_reverse_iterator`] | Read‐only reverse iterator over the bits. | xref:bitdeque/difference_type.adoc[`difference_type`] | Signed integer type used for distances between iterators. | xref:bitdeque/iterator-05.adoc[`iterator`] | Mutable random‐access iterator over the bits. | xref:bitdeque/pointer.adoc[`pointer`] | Pointer type, void because individual bits are not addressable. | xref:bitdeque/reference.adoc[`reference`] | Proxy reference to a single bit, returned by mutable element access. | xref:bitdeque/reverse_iterator.adoc[`reverse_iterator`] | Mutable reverse iterator over the bits. | xref:bitdeque/size_type.adoc[`size_type`] | Unsigned integer type used for sizes and bit indices. | xref:bitdeque/value_type.adoc[`value_type`] | Type of the elements stored in the container. |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:bitdeque/2constructor-03.adoc[`bitdeque`] [.small]#[constructor]# | Constructors | xref:bitdeque/operator_assign-05.adoc[`operator=`] | Assignment operators | xref:bitdeque/assign-08.adoc[`assign`] | `assign` overloads | xref:bitdeque/at-0b.adoc[`at`] | Access an element with bounds checking, throwing std::out_of_range if out of bounds. | xref:bitdeque/back-02.adoc[`back`] | Access the last element. | xref:bitdeque/begin-05.adoc[`begin`] | `begin` overloads | xref:bitdeque/cbegin.adoc[`cbegin`] | Return a read‐only iterator to the first bit. | xref:bitdeque/cend.adoc[`cend`] | Return a read‐only iterator past the last bit. | xref:bitdeque/clear.adoc[`clear`] | Empty the container. | xref:bitdeque/crbegin.adoc[`crbegin`] | Return a read‐only reverse iterator to the last bit. | xref:bitdeque/crend.adoc[`crend`] | Return a read‐only reverse iterator before the first bit. | xref:bitdeque/emplace.adoc[`emplace`] | Insert a single bit before the given position. | xref:bitdeque/emplace_back.adoc[`emplace_back`] | Append an element to the end of the container and return a reference to it. | xref:bitdeque/emplace_front.adoc[`emplace_front`] | Prepend an element to the front of the container and return a reference to it. | xref:bitdeque/empty.adoc[`empty`] | Determine whether the container is empty. | xref:bitdeque/end-03.adoc[`end`] | `end` overloads | xref:bitdeque/erase-07.adoc[`erase`] | `erase` overloads | xref:bitdeque/front-0b.adoc[`front`] | Access the first element. | xref:bitdeque/insert-08.adoc[`insert`] | `insert` overloads | xref:bitdeque/max_size.adoc[`max_size`] | Return the maximum size of the container. | xref:bitdeque/operator_subs-02.adoc[`operator[]`] | Access an element without bounds checking. | xref:bitdeque/pop_back.adoc[`pop_back`] | Remove the last element from the container. | xref:bitdeque/pop_front.adoc[`pop_front`] | Remove the first element from the container. | xref:bitdeque/push_back.adoc[`push_back`] | Append an element to the end of the container. | xref:bitdeque/push_front.adoc[`push_front`] | Prepend an element to the front of the container. | xref:bitdeque/rbegin-06.adoc[`rbegin`] | `rbegin` overloads | xref:bitdeque/rend-03.adoc[`rend`] | `rend` overloads | xref:bitdeque/resize.adoc[`resize`] | Resize the container. | xref:bitdeque/shrink_to_fit.adoc[`shrink_to_fit`] | Release unused memory. | xref:bitdeque/size.adoc[`size`] | Count the number of bits in the container. | xref:bitdeque/swap.adoc[`swap`] | Exchange the contents of this container with another. |=== == Friends [cols="1,4"] |=== | Name| Description | `xref:swap-06.adoc[swap]` | Exchange the contents of two containers. | `bitdeque::Iterator` | |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#