[#bsl-vectorBase-06] = xref:bsl.adoc[bsl]::vectorBase :relfileprefix: ../ :mrdocs: Allocator‐independent storage layout shared by `vector`. == Synopsis Declared in `<bslstl_vector.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class VALUE_TYPE> class vectorBase; ---- == Description This class describes the basic layout for a vector class, to be included into the `vector` layout _before_ the allocator (provided by `bslalg::ContainerBase`) to take better advantage of cache prefetching. It is parameterized by `VALUE_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). This class intentionally has *no* creators (other than the compiler‐generated ones). == Type Aliases [cols="1,4"] |=== | Name| Description | xref:bsl/vectorBase-06/const_iterator.adoc[`const_iterator`] | This `typedef` is an alias to `VALUE_TYPE const *`. | xref:bsl/vectorBase-06/const_reference.adoc[`const_reference`] | This `typedef` is an alias to `VALUE_TYPE const&`. | xref:bsl/vectorBase-06/const_reverse_iterator.adoc[`const_reverse_iterator`] | This `typedef` is an alias to `bsl::reverse_iterator<const_iterator>`. | xref:bsl/vectorBase-06/difference_type.adoc[`difference_type`] | This `typedef` is an alias to `std::ptrdiff_t`. | xref:bsl/vectorBase-06/iterator.adoc[`iterator`] | This `typedef` is an alias to `VALUE_TYPE *`. | xref:bsl/vectorBase-06/reference.adoc[`reference`] | This `typedef` is an alias to `VALUE_TYPE&`. | xref:bsl/vectorBase-06/reverse_iterator.adoc[`reverse_iterator`] | This `typedef` is an alias to `bsl::reverse_iterator<iterator>`. | xref:bsl/vectorBase-06/size_type.adoc[`size_type`] | This `typedef` is an alias to `std::size_t`. | xref:bsl/vectorBase-06/value_type.adoc[`value_type`] | This `typedef` is an alias to the (template parameter) `VALUE_TYPE`. |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:bsl/vectorBase-06/2constructor.adoc[`vectorBase`] [.small]#[constructor]# | Create an empty base object with no capacity. | xref:bsl/vectorBase-06/adopt.adoc[`adopt`] | Adopt memory allocations from the specified `base` object. | xref:bsl/vectorBase-06/at-0cb.adoc[`at`] | `at` overloads | xref:bsl/vectorBase-06/back-04.adoc[`back`] | `back` overloads | xref:bsl/vectorBase-06/begin-0ce8.adoc[`begin`] | `begin` overloads | xref:bsl/vectorBase-06/capacity.adoc[`capacity`] | Return the capacity of this vector, i.e., the maximum number of elements for which resizing is guaranteed not to trigger a reallocation. | xref:bsl/vectorBase-06/cbegin.adoc[`cbegin`] | Return a const iterator to the first element. | xref:bsl/vectorBase-06/cend.adoc[`cend`] | Return the past‐the‐end (forward) iterator providing non‐modifiable access to this vector. | xref:bsl/vectorBase-06/crbegin.adoc[`crbegin`] | Return a reverse iterator providing non‐modifiable access to the last element in this vector, and the past‐the‐end reverse iterator if this vector is empty. | xref:bsl/vectorBase-06/crend.adoc[`crend`] | Return the past‐the‐end reverse iterator providing non‐modifiable access to this vector. | xref:bsl/vectorBase-06/data-0e.adoc[`data`] | `data` overloads | xref:bsl/vectorBase-06/empty.adoc[`empty`] | Return `true` if this vector has size 0, and `false` otherwise. | xref:bsl/vectorBase-06/end-0c.adoc[`end`] | `end` overloads | xref:bsl/vectorBase-06/front-05.adoc[`front`] | `front` overloads | xref:bsl/vectorBase-06/operator_subs-02.adoc[`operator[]`] | Subscript operators | xref:bsl/vectorBase-06/rbegin-09.adoc[`rbegin`] | `rbegin` overloads | xref:bsl/vectorBase-06/rend-01.adoc[`rend`] | `rend` overloads | xref:bsl/vectorBase-06/size.adoc[`size`] | Return the number of elements in this vector. |=== == Protected Data Members [cols="1,4"] |=== | Name| Description | xref:bsl/vectorBase-06/d_capacity.adoc[`d_capacity`] | Capacity of data storage in number of elements. | xref:bsl/vectorBase-06/d_dataBegin_p.adoc[`d_dataBegin_p`] | Beginning of data storage (owned). | xref:bsl/vectorBase-06/d_dataEnd_p.adoc[`d_dataEnd_p`] | One past the end of data storage. |=== == Derived Classes [cols="1,4"] |=== | Name| Description | xref:bsl/vector-00d.adoc[`vector`] | STL‐compliant sequence container conforming to the `bslma` model. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#