C++ STL vector class cheatsheet

Quick reference to the C++ vector class.

Next is a brief description of what you can find in the pdf.
 

Method Description
assign Fills the vector with a given value.
at Returns a reference to the element at the given index.
back Returns a reference to the vector's last element.
begin Returns an iterator to the first element of the vector.
capacity Returns the number of allocated positions in the vector.
clear Removes all the elements from the vector.
empty Returns true if the vector is empty.
end Returns an iterator to the position just after the last element of the vector.
erase Erases a set of elements from the string.
front Returns a reference to the first element of the vector.
insert Inserts an element into given position in the vector.
max_size Returns the maximum number of elements the vector can hold.
pop_back Removes the element at the end of the vector.
push_back Inserts an element at the end of the vector.
rbegin Returns a reverse iterator to the end of the vector.
rend Returns a reverse iterator to the beginning of the vector.
reserve Sets the minimum capacity of the vector.
resize Alters the size of the vector and initiates new positions.
size Returns the number of elements in the vector.
swap Swaps the content of the vector with the content of a container.

Attachments: