[#bsl-vectorBase-06a] = xref:bsl.adoc[bsl]::vectorBase :relfileprefix: ../ :mrdocs: 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). == Synopsis Declared in `<bslstl_vector.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class VALUE_TYPE> class vectorBase; ---- == Type Aliases [cols="1,4"] |=== | Name| Description | xref:bsl/vectorBase-06a/const_iterator.adoc[`const_iterator`] | This `typedef` is an alias to `VALUE_TYPE const *`. | xref:bsl/vectorBase-06a/const_reference.adoc[`const_reference`] | This `typedef` is an alias to `VALUE_TYPE const&`. | xref:bsl/vectorBase-06a/const_reverse_iterator.adoc[`const_reverse_iterator`] | This `typedef` is an alias to `bsl::reverse_iterator<const_iterator>`. | xref:bsl/vectorBase-06a/difference_type.adoc[`difference_type`] | This `typedef` is an alias to `std::ptrdiff_t`. | xref:bsl/vectorBase-06a/iterator.adoc[`iterator`] | This `typedef` is an alias to `VALUE_TYPE *`. | xref:bsl/vectorBase-06a/reference.adoc[`reference`] | This `typedef` is an alias to `VALUE_TYPE&`. | xref:bsl/vectorBase-06a/reverse_iterator.adoc[`reverse_iterator`] | This `typedef` is an alias to `bsl::reverse_iterator<iterator>`. | xref:bsl/vectorBase-06a/size_type.adoc[`size_type`] | This `typedef` is an alias to `std::size_t`. | xref:bsl/vectorBase-06a/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-06a/2constructor.adoc[`vectorBase`] [.small]#[constructor]# | Create an empty base object with no capacity. | xref:bsl/vectorBase-06a/adopt.adoc[`adopt`] | Adopt all outstanding memory allocations associated with the specified `base` object. The behavior is undefined unless this object is in a default‐constructed state. | xref:bsl/vectorBase-06a/at-0cb.adoc[`at`] | `at` overloads | xref:bsl/vectorBase-06a/back-04.adoc[`back`] | `back` overloads | xref:bsl/vectorBase-06a/begin-0ce8.adoc[`begin`] | `begin` overloads | xref:bsl/vectorBase-06a/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-06a/cbegin.adoc[`cbegin`] | Return an iterator providing non‐modifiable access to the first element in this vector, and the past‐the‐end iterator if this vector is empty. | xref:bsl/vectorBase-06a/cend.adoc[`cend`] | Return the past‐the‐end (forward) iterator providing non‐modifiable access to this vector. | xref:bsl/vectorBase-06a/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-06a/crend.adoc[`crend`] | Return the past‐the‐end reverse iterator providing non‐modifiable access to this vector. | xref:bsl/vectorBase-06a/data-0e.adoc[`data`] | `data` overloads | xref:bsl/vectorBase-06a/empty.adoc[`empty`] | Return `true` if this vector has size 0, and `false` otherwise. | xref:bsl/vectorBase-06a/end-0c.adoc[`end`] | `end` overloads | xref:bsl/vectorBase-06a/front-05.adoc[`front`] | `front` overloads | xref:bsl/vectorBase-06a/operator_subs-02.adoc[`operator[]`] | Subscript operators | xref:bsl/vectorBase-06a/rbegin-09.adoc[`rbegin`] | `rbegin` overloads | xref:bsl/vectorBase-06a/rend-01.adoc[`rend`] | `rend` overloads | xref:bsl/vectorBase-06a/size.adoc[`size`] | Return the number of elements in this vector. |=== == Protected Data Members [cols="1,4"] |=== | Name| Description | xref:bsl/vectorBase-06a/d_capacity.adoc[`d_capacity`] | Capacity of data storage in number of elements. | xref:bsl/vectorBase-06a/d_dataBegin_p.adoc[`d_dataBegin_p`] | Beginning of data storage (owned). | xref:bsl/vectorBase-06a/d_dataEnd_p.adoc[`d_dataEnd_p`] | One past the end of data storage. |=== == Specializations [cols="1"] |=== | Name | xref:bsl/vectorBase-09.adoc[`vectorBase<bool>`] | xref:bsl/vectorBase-0aa3.adoc[`vectorBase<char>`] | xref:bsl/vectorBase-068.adoc[`vectorBase<double>`] | xref:bsl/vectorBase-06e.adoc[`vectorBase<float>`] | xref:bsl/vectorBase-03d.adoc[`vectorBase<int>`] | xref:bsl/vectorBase-0b2.adoc[`vectorBase<long>`] | xref:bsl/vectorBase-0cf.adoc[`vectorBase<long double>`] | xref:bsl/vectorBase-0f7.adoc[`vectorBase<long long>`] | xref:bsl/vectorBase-0fd.adoc[`vectorBase<short>`] | xref:bsl/vectorBase-0c1.adoc[`vectorBase<signed char>`] | xref:bsl/vectorBase-033.adoc[`vectorBase<unsigned char>`] | xref:bsl/vectorBase-08.adoc[`vectorBase<unsigned int>`] | xref:bsl/vectorBase-0e9.adoc[`vectorBase<unsigned long>`] | xref:bsl/vectorBase-0aa9.adoc[`vectorBase<unsigned long long>`] | xref:bsl/vectorBase-074.adoc[`vectorBase<unsigned short>`] | xref:bsl/vectorBase-0bb.adoc[`vectorBase<void*>`] | xref:bsl/vectorBase-0af.adoc[`vectorBase<char const*>`] |=== == Derived Classes [cols="1,4"] |=== | Name| Description | xref:bsl/vector-008.adoc[`vector<Json>`] | This class template provides an STL‐compliant `vector` that conforms to the `bslma::Allocator` model. For the requirements of a vector class, consult the C++11 standard. In particular, this implementation offers the general rules that: | xref:bsl/vector-00d.adoc[`vector`] | This class template provides an STL‐compliant `vector` that conforms to the `bslma::Allocator` model. For the requirements of a vector class, consult the C++11 standard. In particular, this implementation offers the general rules that: | xref:bsl/vector-020.adoc[`vector<float>`] | | xref:bsl/vector-027.adoc[`vector<MetricSampleGroup>`] | This class template provides an STL‐compliant `vector` that conforms to the `bslma::Allocator` model. For the requirements of a vector class, consult the C++11 standard. In particular, this implementation offers the general rules that: | xref:bsl/vector-029.adoc[`vector<long long>`] | | xref:bsl/vector-03.adoc[`vector<bool>`] | | xref:bsl/vector-044.adoc[`vector<ZoneinfoTransition>`] | This class template provides an STL‐compliant `vector` that conforms to the `bslma::Allocator` model. For the requirements of a vector class, consult the C++11 standard. In particular, this implementation offers the general rules that: | xref:bsl/vector-047.adoc[`vector<unsigned long long>`] | | xref:bsl/vector-095.adoc[`vector<char>`] | | xref:bsl/vector-099.adoc[`vector<pair<Date, DayOfWeekSet>>`] | This class template provides an STL‐compliant `vector` that conforms to the `bslma::Allocator` model. For the requirements of a vector class, consult the C++11 standard. In particular, this implementation offers the general rules that: | xref:bsl/vector-09a.adoc[`vector<int>`] | | xref:bsl/vector-09c.adoc[`vector<short>`] | | xref:bsl/vector-0a0.adoc[`vector<signed char>`] | | xref:bsl/vector-0a33.adoc[`vector<long>`] | | xref:bsl/vector-0aa7.adoc[`vector<long double>`] | | xref:bsl/vector-0aa9.adoc[`vector<unsigned short>`] | | xref:bsl/vector-0b.adoc[`vector<UserFieldValue>`] | This class template provides an STL‐compliant `vector` that conforms to the `bslma::Allocator` model. For the requirements of a vector class, consult the C++11 standard. In particular, this implementation offers the general rules that: | xref:bsl/vector-0cf.adoc[`vector<unsigned char>`] | | xref:bsl/vector-0e8.adoc[`vector<unsigned long>`] | | xref:bsl/vector-0ea.adoc[`vector<double>`] | | xref:bsl/vector-0ec.adoc[`vector<unsigned int>`] | |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#