[#bitdeque]
= bitdeque
:mrdocs:

Class that mimics std&colon;&colon;deque&lt;bool&gt;, but with std&colon;&colon;vector&lt;bool&gt;&apos;s bit packing&period;

== Synopsis

Declared in `&lt;util&sol;bitdeque&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;int BITS&lowbar;PER&lowbar;WORD = 4096 &ast; 8&gt;
class bitdeque;
----

== Description

BITS&lowbar;PER&lowbar;WORD selects the (minimum) number of bits that are allocated at once&period; Larger values reduce the asymptotic memory usage overhead, at the cost of needing larger up&hyphen;front allocations&period; The default is 4096 bytes&period;

== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:bitdeque/const_iterator.adoc[`const&lowbar;iterator`] 
| Read&hyphen;only random&hyphen;access iterator over the bits&period;
| xref:bitdeque/const_pointer.adoc[`const&lowbar;pointer`] 
| Const pointer type, void because individual bits are not addressable&period;
| xref:bitdeque/const_reference.adoc[`const&lowbar;reference`] 
| Read&hyphen;only reference to a single bit (a plain bool by value)&period;
| xref:bitdeque/const_reverse_iterator.adoc[`const&lowbar;reverse&lowbar;iterator`] 
| Read&hyphen;only reverse iterator over the bits&period;
| xref:bitdeque/difference_type.adoc[`difference&lowbar;type`] 
| Signed integer type used for distances between iterators&period;
| xref:bitdeque/iterator-05.adoc[`iterator`] 
| Mutable random&hyphen;access iterator over the bits&period;
| xref:bitdeque/pointer.adoc[`pointer`] 
| Pointer type, void because individual bits are not addressable&period;
| xref:bitdeque/reference.adoc[`reference`] 
| Proxy reference to a single bit, returned by mutable element access&period;
| xref:bitdeque/reverse_iterator.adoc[`reverse&lowbar;iterator`] 
| Mutable reverse iterator over the bits&period;
| xref:bitdeque/size_type.adoc[`size&lowbar;type`] 
| Unsigned integer type used for sizes and bit indices&period;
| xref:bitdeque/value_type.adoc[`value&lowbar;type`] 
| Type of the elements stored in the container&period;
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:bitdeque/2constructor-03.adoc[`bitdeque`]         [.small]#[constructor]#
| Constructors
| xref:bitdeque/operator_assign-05.adoc[`operator&equals;`] 
| Assignment operators
| xref:bitdeque/assign-08.adoc[`assign`] 
| `assign` overloads
| xref:bitdeque/at-0b.adoc[`at`] 
| Access an element with bounds checking, throwing std&colon;&colon;out&lowbar;of&lowbar;range if out of bounds&period;
| xref:bitdeque/back-02.adoc[`back`] 
| Access the last element&period;
| xref:bitdeque/begin-05.adoc[`begin`] 
| `begin` overloads
| xref:bitdeque/cbegin.adoc[`cbegin`] 
| Return a read&hyphen;only iterator to the first bit&period;
| xref:bitdeque/cend.adoc[`cend`] 
| Return a read&hyphen;only iterator past the last bit&period;
| xref:bitdeque/clear.adoc[`clear`] 
| Empty the container&period;
| xref:bitdeque/crbegin.adoc[`crbegin`] 
| Return a read&hyphen;only reverse iterator to the last bit&period;
| xref:bitdeque/crend.adoc[`crend`] 
| Return a read&hyphen;only reverse iterator before the first bit&period;
| xref:bitdeque/emplace.adoc[`emplace`] 
| Insert a single bit before the given position&period;
| xref:bitdeque/emplace_back.adoc[`emplace&lowbar;back`] 
| Append an element to the end of the container and return a reference to it&period;
| xref:bitdeque/emplace_front.adoc[`emplace&lowbar;front`] 
| Prepend an element to the front of the container and return a reference to it&period;
| xref:bitdeque/empty.adoc[`empty`] 
| Determine whether the container is empty&period;
| 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&period;
| xref:bitdeque/insert-08.adoc[`insert`] 
| `insert` overloads
| xref:bitdeque/max_size.adoc[`max&lowbar;size`] 
| Return the maximum size of the container&period;
| xref:bitdeque/operator_subs-02.adoc[`operator&lsqb;&rsqb;`] 
| Access an element without bounds checking&period;
| xref:bitdeque/pop_back.adoc[`pop&lowbar;back`] 
| Remove the last element from the container&period;
| xref:bitdeque/pop_front.adoc[`pop&lowbar;front`] 
| Remove the first element from the container&period;
| xref:bitdeque/push_back.adoc[`push&lowbar;back`] 
| Append an element to the end of the container&period;
| xref:bitdeque/push_front.adoc[`push&lowbar;front`] 
| Prepend an element to the front of the container&period;
| xref:bitdeque/rbegin-06.adoc[`rbegin`] 
| `rbegin` overloads
| xref:bitdeque/rend-03.adoc[`rend`] 
| `rend` overloads
| xref:bitdeque/resize.adoc[`resize`] 
| Resize the container&period;
| xref:bitdeque/shrink_to_fit.adoc[`shrink&lowbar;to&lowbar;fit`] 
| Release unused memory&period;
| xref:bitdeque/size.adoc[`size`] 
| Count the number of bits in the container&period;
| xref:bitdeque/swap.adoc[`swap`] 
| Exchange the contents of this container with another&period;
|===


== Friends

[cols="1,4"]
|===
| Name| Description
| `xref:swap-06.adoc[swap]`
| Exchange the contents of two containers&period;
| `bitdeque::Iterator`
| 
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
