[#bsl-vector-03]
= xref:bsl.adoc[bsl]::xref:bsl/vector-00d.adoc[vector]&lt;bool&gt;
:relfileprefix: ../
:mrdocs:

== Synopsis

Declared in `&lt;bslstl&lowbar;vector&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;&gt;
class xref:bsl/vector-00d.adoc[vector]&lt;bool&gt;
    : public xref:bsl/vectorBase-06a.adoc[vectorBase&lt;bool&gt;]
----

== Base Classes

[cols="1,4"]
|===
| Name| Description
| `xref:bsl/vectorBase-06a.adoc[vectorBase&lt;bool&gt;]`
| This class describes the basic layout for a vector class, to be included into the `vector` layout _before_ the allocator (provided by `bslalg&colon;&colon;ContainerBase`) to take better advantage of cache prefetching&period; It is parameterized by `VALUE&lowbar;TYPE` only, and implements the portion of `vector` that does not need to know about its (template parameter) type `ALLOCATOR` (in order to generate shorter debug strings)&period; This class intentionally has *no* creators (other than the compiler&hyphen;generated ones)&period;
|===

== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:bsl/vector-03/allocator_type.adoc[`allocator&lowbar;type`] 
| This `typedef` is an alias to the (template parameter) `ALLOCATOR`&period;
| xref:bsl/vector-03/const_iterator.adoc[`const&lowbar;iterator`] 
| This `typedef` is an alias to `VALUE&lowbar;TYPE const &ast;`&period;
| xref:bsl/vector-03/const_pointer.adoc[`const&lowbar;pointer`] 
| This `typedef` is an alias to `AllocatorTraits&colon;&colon;const&lowbar;pointer`&period;
| xref:bsl/vector-03/const_reference.adoc[`const&lowbar;reference`] 
| This `typedef` is an alias to `VALUE&lowbar;TYPE const&amp;`&period;
| xref:bsl/vector-03/const_reverse_iterator.adoc[`const&lowbar;reverse&lowbar;iterator`] 
| This `typedef` is an alias to `bsl&colon;&colon;reverse&lowbar;iterator&lt;const&lowbar;iterator&gt;`&period;
| xref:bsl/vector-03/difference_type.adoc[`difference&lowbar;type`] 
| This `typedef` is an alias to `AllocatorTraits&colon;&colon;difference&lowbar;type`&period;
| xref:bsl/vector-03/iterator.adoc[`iterator`] 
| This `typedef` is an alias to `VALUE&lowbar;TYPE &ast;`&period;
| xref:bsl/vector-03/pointer.adoc[`pointer`] 
| This `typedef` is an alias to `AllocatorTraits&colon;&colon;pointer`&period;
| xref:bsl/vector-03/reference.adoc[`reference`] 
| This `typedef` is an alias to `VALUE&lowbar;TYPE&amp;`&period;
| xref:bsl/vector-03/reverse_iterator.adoc[`reverse&lowbar;iterator`] 
| This `typedef` is an alias to `bsl&colon;&colon;reverse&lowbar;iterator&lt;iterator&gt;`&period;
| xref:bsl/vector-03/size_type.adoc[`size&lowbar;type`] 
| This `typedef` is an alias to `AllocatorTraits&colon;&colon;size&lowbar;type`&period;
| xref:bsl/vector-03/value_type.adoc[`value&lowbar;type`] 
| This `typedef` is an alias to the (template parameter) `VALUE&lowbar;TYPE`&period;
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:bsl/vector-03/2constructor-0d1.adoc[`vector`]         [.small]#[constructor]#
| Constructors
| xref:bsl/vector-03/2destructor.adoc[`&#126;vector`] [.small]#[destructor]#
| Destroy this vector&period;
| xref:bsl/vector-03/operator_assign-06d.adoc[`operator&equals;`] 
| Assignment operators
| xref:bsl/vectorBase-09/adopt.adoc[`adopt`] 
| Adopt all outstanding memory allocations associated with the specified `base` object&period; The behavior is undefined unless this object is in a default&hyphen;constructed state&period;
| xref:bsl/vector-03/append_range.adoc[`append&lowbar;range`] 
| Append to the end of this object the elements of the specified `range`&period; Note that `range` must meet the requirements of an input range and the values from `range` must have a type matching or convertible to (template parameter) `VALUE&lowbar;TYPE`&period;
| xref:bsl/vector-03/assign-05.adoc[`assign`] 
| `assign` overloads
| xref:bsl/vector-03/assign_range.adoc[`assign&lowbar;range`] 
| Assign to this object the elements of the specified `range`&period; Note that `range` must meet the requirements of an input range and the values from `range` must have a type matching or convertible to (template parameter) `VALUE&lowbar;TYPE`&period;
| xref:bsl/vector-03/at.adoc[`at`] 
| `at` overloads
| xref:bsl/vector-03/back.adoc[`back`] 
| `back` overloads
| xref:bsl/vector-03/begin.adoc[`begin`] 
| `begin` overloads
| xref:bsl/vectorBase-09/capacity.adoc[`capacity`] 
| Return the capacity of this vector, i&period;e&period;, the maximum number of elements for which resizing is guaranteed not to trigger a reallocation&period;
| xref:bsl/vectorBase-09/cbegin.adoc[`cbegin`] 
| Return an iterator providing non&hyphen;modifiable access to the first element in this vector, and the past&hyphen;the&hyphen;end iterator if this vector is empty&period;
| xref:bsl/vectorBase-09/cend.adoc[`cend`] 
| Return the past&hyphen;the&hyphen;end (forward) iterator providing non&hyphen;modifiable access to this vector&period;
| xref:bsl/vector-03/clear.adoc[`clear`] 
| Remove all elements from this vector making its size 0&period; Note that although this vector is empty after this method returns, it preserves the same capacity it had before the method was called&period;
| xref:bsl/vectorBase-09/crbegin.adoc[`crbegin`] 
| Return a reverse iterator providing non&hyphen;modifiable access to the last element in this vector, and the past&hyphen;the&hyphen;end reverse iterator if this vector is empty&period;
| xref:bsl/vectorBase-09/crend.adoc[`crend`] 
| Return the past&hyphen;the&hyphen;end reverse iterator providing non&hyphen;modifiable access to this vector&period;
| xref:bsl/vector-03/data.adoc[`data`] 
| `data` overloads
| xref:bsl/vector-03/emplace.adoc[`emplace`] 
| Insert at the specified `position` in this vector a newly created `value&lowbar;type` object, constructed by forwarding `get&lowbar;allocator()` (if required) and the specified (variable number of) `arguments` to the corresponding constructor of `value&lowbar;type`, and return an iterator referring to the newly created and inserted element&period; If an exception is thrown (other than by the copy constructor, move constructor, assignment operator, or move assignment operator of `value&lowbar;type`), `&ast;this` is unaffected&period; Throw `std&colon;&colon;length&lowbar;error` if `size() &equals;&equals; max&lowbar;size()`&period; The behavior is undefined unless `position` is an iterator in the range `&lsqb;begin() &period;&period; end()&rsqb;` (both endpoints included)&period; This method requires that the (template parameter) type `VALUE&lowbar;TYPE` be `move&hyphen;insertable` into this vector and `emplace&hyphen;constructible` from `arguments` (see &lcub;Requirements on `VALUE&lowbar;TYPE`&rcub;)&period;
| xref:bsl/vector-03/emplace_back.adoc[`emplace&lowbar;back`] 
| Append to the end of this vector a newly created `value&lowbar;type` object, constructed by forwarding `get&lowbar;allocator()` (if required) and the specified (variable number of) `arguments` to the corresponding constructor of `value&lowbar;type`&period; Return a reference providing modifiable access to the inserted element&period; If an exception is thrown (other than by the move constructor of a non&hyphen;copy&hyphen;insertable `value&lowbar;type`), `&ast;this` is unaffected&period; Throw `std&colon;&colon;length&lowbar;error` if `size() &equals;&equals; max&lowbar;size()`&period; This method requires that the (template parameter) type `VALUE&lowbar;TYPE` be `move&hyphen;insertable` into this vector and `emplace&hyphen;constructible` from `arguments` (see &lcub;Requirements on `VALUE&lowbar;TYPE`&rcub;)&period;
| xref:bsl/vectorBase-09/empty.adoc[`empty`] 
| Return `true` if this vector has size 0, and `false` otherwise&period;
| xref:bsl/vector-03/end.adoc[`end`] 
| `end` overloads
| xref:bsl/vector-03/erase-03.adoc[`erase`] 
| `erase` overloads
| xref:bsl/vector-03/front.adoc[`front`] 
| `front` overloads
| xref:bsl/vector-03/get_allocator.adoc[`get&lowbar;allocator`] 
| Return (a copy of) the allocator used for memory allocation by this vector&period;
| xref:bsl/vector-03/insert-0d.adoc[`insert`] 
| `insert` overloads
| xref:bsl/vector-03/insert_range.adoc[`insert&lowbar;range`] 
| Insert at the specified `position` in this object the elements of the specified `range`&period; Note that `range` must meet the requirements of an input range and the values from `range` must have a type matching or convertible to (template parameter) `VALUE&lowbar;TYPE`&period;
| xref:bsl/vector-03/max_size.adoc[`max&lowbar;size`] 
| Return a theoretical upper bound on the largest number of elements that this vector could possibly hold&period; Note that there is no guarantee that the vector can successfully grow to the returned size, or even close to that size without running out of resources&period; Also note that requests to create a vector longer than this number of elements are guaranteed to raise a `std&colon;&colon;length&lowbar;error` exception&period;
| xref:bsl/vector-03/operator_subs.adoc[`operator&lsqb;&rsqb;`] 
| Subscript operators
| xref:bsl/vector-03/pop_back.adoc[`pop&lowbar;back`] 
| Erase the last element from this vector&period; The behavior is undefined if this vector is empty&period;
| xref:bsl/vector-03/push_back-06.adoc[`push&lowbar;back`] 
| `push&lowbar;back` overloads
| xref:bsl/vector-03/rbegin.adoc[`rbegin`] 
| `rbegin` overloads
| xref:bsl/vector-03/rend.adoc[`rend`] 
| `rend` overloads
| xref:bsl/vector-03/reserve.adoc[`reserve`] 
| Change the capacity of this vector to the specified `newCapacity`&period; If an exception is thrown (other than by the move constructor of a non&hyphen;copy&hyphen;insertable `value&lowbar;type`), `&ast;this` is unaffected&period; Throw `bsl&colon;&colon;length&lowbar;error` if `newCapacity &gt; max&lowbar;size()`&period; This method requires that the (template parameter) type `VALUE&lowbar;TYPE` be `move&hyphen;insertable` into this vector (see &lcub;Requirements on `VALUE&lowbar;TYPE`&rcub;)&period; Note that the capacity of this vector after this operation has completed may be greater than `newCapacity`&period;
| xref:bsl/vector-03/resize-05.adoc[`resize`] 
| `resize` overloads
| xref:bsl/vector-03/shrink_to_fit.adoc[`shrink&lowbar;to&lowbar;fit`] 
| Reduce the capacity of this vector to its size&period; If an exception is thrown (other than by the move constructor of a non&hyphen;copy&hyphen;insertable `value&lowbar;type`), `&ast;this` is unaffected&period; Note that this method has no effect if the capacity is equivalent to the size&period;
| xref:bsl/vectorBase-09/size.adoc[`size`] 
| Return the number of elements in this vector&period;
| xref:bsl/vector-03/swap.adoc[`swap`] 
| Exchange the value of this object with that of the specified `other` object&semi; also exchange the allocator of this object with that of `other` if the (template parameter) type `ALLOCATOR` has the `propagate&lowbar;on&lowbar;container&lowbar;swap` trait, and do not modify either allocator otherwise&period; This method provides the no&hyphen;throw exception&hyphen;safety guarantee&period; This operation has `O&lsqb;1&rsqb;` complexity if either this object was created with the same allocator as `other` or `ALLOCATOR` has the `propagate&lowbar;on&lowbar;container&lowbar;swap` trait&semi; otherwise, it has `O&lsqb;n &plus; m&rsqb;` complexity, where `n` and `m` are the number of elements in this object and `other`, respectively&period; Note that this method&grave;s support for swapping objects created with different allocators when `ALLOCATOR` does not have the `propagate&lowbar;on&lowbar;container&lowbar;swap` trait is a departure from the C&plus;&plus; Standard&period;
|===


== Protected Data Members

[cols="1,4"]
|===
| Name| Description
| xref:bsl/vectorBase-09/d_capacity.adoc[`d&lowbar;capacity`] 
| Capacity of data storage in number of elements&period;
| xref:bsl/vectorBase-09/d_dataBegin_p.adoc[`d&lowbar;dataBegin&lowbar;p`] 
| Beginning of data storage (owned)&period;
| xref:bsl/vectorBase-09/d_dataEnd_p.adoc[`d&lowbar;dataEnd&lowbar;p`] 
| One past the end of data storage&period;
|===



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