stl:list:start

C++ Reference

C++ Lists

Lists are sequences of elements stored in a linked list. Compared to vectors, they allow fast insertions and deletions, but slower random access.

Constructorscreate lists and initialize them with some data
Operatorsassign and compare lists
assignassign elements to a list
backreturns a reference to last element of a list
beginreturns an iterator to the beginning of the list
clearremoves all elements from the list
emptytrue if the list has no elements
endreturns an iterator just past the last element of a list
eraseremoves elements from a list
frontreturns a reference to the first element of a list
insertinserts elements into the list
max_sizereturns the maximum number of elements that the list can hold
mergemerge two lists
pop_backremoves the last element of a list
pop_frontremoves the first element of the list
push_backadd an element to the end of the list
push_frontadd an element to the front of the list
rbeginreturns a reverse_iterator to the end of the list
removeremoves elements from a list
remove_ifremoves elements conditionally
rendreturns a reverse_iterator to the beginning of the list
resizechange the size of the list
reversereverse the list
sizereturns the number of items in the list
sortsorts a list into ascending order
splicemerge two lists in constant time
swapswap the contents of this list with another
uniqueremoves consecutive duplicate elements