发布时间:2022-07-05 文章分类:编程知识 投稿人:赵颖 字号: 默认 | | 超大 打印
STL vector vs list function comparison:
Function vector list
constructor yes yes
destructor yes yes
empty() yes yes
size() yes yes
resize() yes yes
capacity() yes no
reserve() yes no
max_size() yes yes
erase() yes yes
clear() yes yes
operator= yes yes
operator< yes yes
operator== yes yes
operator[] yes no
at() yes no
front() yes yes
back() yes yes
push_back() yes yes
pop_back() yes yes
assign() yes yes
insert() yes yes
swap() yes yes
push_front() no yes
pop_front() no yes
merge() no yes
remove() no yes
remove_if() no yes
reverse() no yes
sort() no yes
splice() no yes
unique() no yes