本文共 589 字,大约阅读时间需要 1 分钟。
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 |
转载地址:http://snkta.baihongyu.com/