Vector Function
Vector Function
Function
max_size() Returns the maximum number of elements that the vector can hold.
rbegin() Returns a reverse iterator pointing to the last element of the vector.
rend() Returns a reverse iterator pointing to the element preceding the first element of
the vector.
swap() Swaps the contents of the vector with those of another vector.
assign() Assigns new values to the vector elements by replacing old ones.
capacity() Returns the size of the storage space currently allocated to the vector.
reserve() Requests that the vector capacity be at least enough to contain a specified
number of elements.
shrink_to_fit() Reduces memory usage by freeing unused space.
data() Returns a direct pointer to the memory array used internally by the vector to
store its owned elements.
get_allocator Returns a copy of the allocator object associated with the vector.