C++ 标准库
参考资料
标准模板库
标准模板库(STL,Standard Template Library)是 C++ 标准库的一部分,里面包含了一些模板化的通用的数据结构和算法。
STL 容器

序列式容器
array
vector
deque
The "ueue" in "queue" is silent, but not in "deque."
访问:
front()返回队首元素back()返回队尾元素
修改:
push_back()将元素添加到容器末尾pop_back()移除末元素push_front()插入元素到容器起始pop_front()移除首元素clear()清除内容insert()在指定位置前插入元素(传入迭代器和元素,)erase()擦除指定位置的元素(传入迭代器,)
容量:
empty()检查容器是否为空size()返回元素数
list
forward_list
关联式容器
set
multiset
map
multimap
无序关联式容器
unordered_set
unordered_multiset
unordered_map
unordered_multimap
容器适配器
stack
访问:
top()访问栈顶元素
修改:
push()向栈顶插入元素pop()移除栈顶元素
容器:
empty()检查容器适配器是否为空size()返回元素数
queue
访问:
front()访问第一个元素back()访问最后一个元素
修改:
push()向队列尾部插入元素pop()移除首个元素
容器:
empty()检查容器适配器是否为空size()返回元素数
priority_queue
其他容器(非 STL 容器)
bitset
string
pair
tuple
STL 算法
std::findstd::reversestd::uniquestd::shufflestd::sortstd::binary_searchstd::lower_boundstd::upper_boundstd::next_permutationstd::prev_permutation- ...