六大组件
STL提供六大组件,彼此可以组合套用。
- 容器 (container)
- 算法 (Algorithm)
- 迭代器 (Iterator)
- 仿函数 (Functor)
- 配接器 (Adaptor)
- 配置器 (Allocator)
Container通过Allocator取得数据存储空间,Algorithm通过Iterator存取Container内容,Functor可以协助Algorithm完成不同的策略变化,Adapter可以修饰或套接Functor。
STL提供六大组件,彼此可以组合套用。
Container通过Allocator取得数据存储空间,Algorithm通过Iterator存取Container内容,Functor可以协助Algorithm完成不同的策略变化,Adapter可以修饰或套接Functor。