STL简介

STL简介

简介

STL,Standard Template Library,是C++标准委员会推出的c++标准库。主要由6大组成部分:容器(containers)、算法(algorithms)、迭代器(iterators)、仿函数(functors)、配接器(adapters)、空间配置器(allocator)。

容器(container)

容器对常见数据结构的封装。

容器类模板名称(类模板)版本
顺序容器array静态数组(类模板)(C++11 起)
vector动态数组(类模板)
deque双端队列(类模板)
forward_list单链表(类模板)(C++11 起)
list双链表(类模板)
关联容器set集合
map映射
multiset复值集合
multimap复键映射
无序关联容器unordered_set无序集合(hash集合)(C++11 起)
unordered_map无序映射()(C++11 起)
unordered_multiset无序复值集合(C++11 起)
unordered_multimap无序哈希映射(C++11 起)

算法

迭代器

updatedupdated2024-05-102024-05-10