STL list 简介
Lists are sequence containers that allow constant time insert and erase operations anywhere within the sequence, and iteration in both directions.
【STL list 官网】
https://cplusplus.com/reference/list/list/
Lists are sequence containers that allow constant time insert and erase operations anywhere within the sequence, and iteration in both directions.
【STL list 常用函数】
● list::begin:https://cplusplus.com/reference/list/list/begin/
Returns an iterator pointing to the first element in the list container.
● list::end:https://cplusplus.com/reference/list/list/end/
Returns an iterator referring to the past-the-end element in the list container.
● list::front:https://cplusplus.com/reference/list/list/front/
Returns a reference to the first element in the list container.
● list::back:https://cplusplus.com/reference/list/list/back/
Returns a reference to the last element in the list container.
● list::push_back:https://cplusplus.com/reference/list/list/push_back/
Adds a new element at the end of the list container, after its current last element.
● list::push_front:https://cplusplus.com/reference/list/list/push_front/
Inserts a new element at the beginning of the list, right before its current first element.
● list::pop_back:https://cplusplus.com/reference/list/list/pop_back/
Removes the last element in the list container, effectively reducing the container size by one.
● list::pop_front:https://cplusplus.com/reference/list/list/pop_front/
Removes the first element in the list container, effectively reducing its size by one.
● list::insert:https://cplusplus.com/reference/list/list/insert/
The container is extended by inserting new elements before the element at the specified position.
● list::erase:https://cplusplus.com/reference/list/list/erase/
Removes from the list container either a single element (position) or a range of elements ([first,last)).
● list::reverse:https://cplusplus.com/reference/list/list/reverse/
Reverses the order of the elements in the list container.
● list::unique:https://cplusplus.com/reference/list/list/unique/
The version with no parameters (1), removes all but the first element from every consecutive group of equal elements in the container.
● list::erase:https://cplusplus.com/reference/list/list/erase/
Removes from the list container either a single element (position) or a range of elements ([first,last)).
【STL list 典型应用】
https://blog.csdn.net/hnjzsyjyj/article/details/151951276
https://blog.csdn.net/hnjzsyjyj/article/details/143648666
https://blog.csdn.net/hnjzsyjyj/article/details/143416784
https://blog.csdn.net/hnjzsyjyj/article/details/143422002
更多推荐




所有评论(0)