Allocator‐independent storage layout shared by vector.

Synopsis

Declared in <bslstl_vector.h>

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

Name

Description

const_iterator

This typedef is an alias to VALUE_TYPE const *.

const_reference

This typedef is an alias to VALUE_TYPE const&.

const_reverse_iterator

This typedef is an alias to bsl::reverse_iterator<const_iterator>.

difference_type

This typedef is an alias to std::ptrdiff_t.

iterator

This typedef is an alias to VALUE_TYPE *.

reference

This typedef is an alias to VALUE_TYPE&.

reverse_iterator

This typedef is an alias to bsl::reverse_iterator<iterator>.

size_type

This typedef is an alias to std::size_t.

value_type

This typedef is an alias to the (template parameter) VALUE_TYPE.

Member Functions

Name

Description

vectorBase [constructor]

Create an empty base object with no capacity.

adopt

Adopt memory allocations from the specified base object.

at

at overloads

back

back overloads

begin

begin overloads

capacity

Return the capacity of this vector, i.e., the maximum number of elements for which resizing is guaranteed not to trigger a reallocation.

cbegin

Return a const iterator to the first element.

cend

Return the past‐the‐end (forward) iterator providing non‐modifiable access to this vector.

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.

crend

Return the past‐the‐end reverse iterator providing non‐modifiable access to this vector.

data

data overloads

empty

Return true if this vector has size 0, and false otherwise.

end

end overloads

front

front overloads

operator[]

Subscript operators

rbegin

rbegin overloads

rend

rend overloads

size

Return the number of elements in this vector.

Protected Data Members

Name

Description

d_capacity

Capacity of data storage in number of elements.

d_dataBegin_p

Beginning of data storage (owned).

d_dataEnd_p

One past the end of data storage.

Derived Classes

Name

Description

vector

STL‐compliant sequence container conforming to the bslma model.

Created with MrDocs