The following table shows the most commonly used APIs of an STL list:
|
API |
Description |
|
front() |
This returns the first value stored in the list |
|
back() |
This returns the last value stored in the list |
|
size() |
This returns the count of values stored in the list |
|
empty() |
This returns true when the list is empty, and false otherwise |
|
clear() |
This clears all the values stored in the list |
|
push_back<data_type>( value ) |
This adds a value at the end of the list |
|
push_front<data_type>( value ) |
This adds a value at the front of the list |
|
merge( list ) |
This merges two sorted lists with values of the same type |
|
reverse() |
This reverses the list |
|
unique() |
This removes duplicate values from the list |
|
sort() |
This sorts the values stored in a list |